From 61bab8518bc8b5cdb15a06aceca281eeffafdb43 Mon Sep 17 00:00:00 2001 From: Holger Reise Date: Tue, 7 May 2024 09:53:15 +0200 Subject: [PATCH] Initial commit --- .github/dependabot.yml | 19 + .github/workflows/build-and-push.yml | 73 + LICENSE | 2 +- application/pom.xml | 208 ++ .../migration/application/MigrationTool.java | 81 + .../application/EHRbaseContainerNew.java | 79 + .../application/EHRbaseContainerOld.java | 78 + .../EHRbasePostgresNewContainer.java | 85 + .../EHRbasePostgresOldContainer.java | 85 + .../application/KeycloakMockContainer.java | 130 + .../application/MigrationToolTestIT.java | 489 +++ .../resources/conformance_ehrbase.de.v0.opt | 3168 ++++++++++++++++ ...conformance_ehrbase.de.v0_composition.json | 2589 ++++++++++++++ bom/pom.xml | 159 + pom.xml | 38 + service/pom.xml | 193 + .../org/ehrbase/migration/MigrationUtils.java | 44 + .../config/ExportDatasourceConfiguration.java | 113 + .../config/ImportDatasourceConfiguration.java | 53 + .../org/ehrbase/migration/dto/EhrSchema.java | 20 + .../ehrbase/migration/dto/EhrSchemaData.java | 120 + .../ehrbase/migration/dto/ExtendedEhr.java | 98 + .../dto/SetToSortedSetConverter.java | 48 + .../org/ehrbase/migration/dto/System.java | 22 + .../java/org/ehrbase/migration/dto/User.java | 74 + .../migration/dto/VersionedObjectData.java | 28 + .../migration/exporter/ExportService.java | 57 + .../exporter/ExportServiceConfiguration.java | 38 + .../postprocessor/EhrStatusPostprocessor.java | 43 + .../postprocessor/ExportPostprocessor.java | 30 + .../PostprocessorConfiguration.java | 37 + .../ValidationPostprocessor.java | 177 + .../migration/exporter/v0/AuditExporter.java | 81 + .../exporter/v0/CompositionExporter.java | 333 ++ .../exporter/v0/ContributionExporter.java | 99 + .../migration/exporter/v0/EhrExporter.java | 53 + .../exporter/v0/EhrSchemaDataExporter.java | 212 ++ .../exporter/v0/EhrStatusExporter.java | 116 + .../exporter/v0/ExportServiceV0Imp.java | 166 + .../migration/exporter/v0/FolderExporter.java | 197 + .../migration/exporter/v0/PartyExporter.java | 192 + .../jooq/binding/OtherDetailsJsonbBinder.java | 165 + .../v0/jooq/binding/SysPeriodBinder.java | 210 ++ .../jooq/dbencoding/CompositeClassName.java | 59 + .../dbencoding/CompositionSerializer.java | 765 ++++ .../v0/jooq/dbencoding/ElementValue.java | 52 + .../exporter/v0/jooq/dbencoding/Elements.java | 41 + .../v0/jooq/dbencoding/EncodeUtilArchie.java | 87 + .../v0/jooq/dbencoding/EntrySerialTree.java | 235 ++ .../v0/jooq/dbencoding/ItemStack.java | 172 + .../exporter/v0/jooq/dbencoding/MultiMap.java | 35 + .../v0/jooq/dbencoding/NameAsDvText.java | 52 + .../v0/jooq/dbencoding/NameInMap.java | 43 + .../v0/jooq/dbencoding/NodeEncoding.java | 77 + .../exporter/v0/jooq/dbencoding/PathItem.java | 76 + .../exporter/v0/jooq/dbencoding/PathMap.java | 40 + .../exporter/v0/jooq/dbencoding/RawJson.java | 63 + .../v0/jooq/dbencoding/RmObjectEncoding.java | 35 + .../v0/jooq/dbencoding/SerialTree.java | 103 + .../v0/jooq/dbencoding/SimpleClassName.java | 34 + .../attributes/ActionAttributes.java | 62 + .../attributes/ActivityAttributes.java | 52 + .../attributes/AdminEntryAttributes.java | 39 + .../attributes/CareEntryAttributes.java | 47 + .../attributes/ClusterAttributes.java | 39 + .../attributes/ContentItemAttributes.java | 33 + .../attributes/DataStructureAttributes.java | 33 + .../attributes/ElementAttributes.java | 112 + .../attributes/EntryAttributes.java | 79 + .../attributes/EvaluationAttributes.java | 41 + .../attributes/EventAttributes.java | 57 + .../attributes/FeederAuditAttributes.java | 80 + .../FeederAuditDetailsAttributes.java | 82 + .../attributes/HistoryAttributes.java | 48 + .../attributes/I_SubjectAttributes.java | 25 + .../attributes/InstructionAttributes.java | 55 + .../InstructionDetailsAttributes.java | 52 + .../attributes/IsmTransitionAttributes.java | 67 + .../dbencoding/attributes/ItemAttributes.java | 32 + .../attributes/ItemStructureAttributes.java | 36 + .../attributes/LinksAttributes.java | 53 + .../attributes/LocatableAttributes.java | 77 + .../attributes/ObservationAttributes.java | 41 + .../OtherParticipationAttributes.java | 59 + .../attributes/PartyIdentifiedAttributes.java | 51 + .../attributes/PartyRelatedAttributes.java | 43 + .../attributes/PartySelfAttributes.java | 48 + .../dbencoding/attributes/RMAttributes.java | 70 + .../attributes/SectionAttributes.java | 41 + .../attributes/SubjectAttributes.java | 47 + .../datavalues/datetime/I_DateAttributes.java | 42 + .../datetime/I_DateTimeAttributes.java | 70 + .../datavalues/datetime/I_PartialTime.java | 55 + .../datetime/I_TemporalAttributes.java | 66 + .../datavalues/datetime/I_TimeAttributes.java | 55 + .../datetime/TemporalAttributes.java | 94 + .../datetime/date/DvDateAttributes.java | 103 + .../datetime/date/DvDateAttributesImp.java | 75 + .../datetime/date/DvDateYYYYImp.java | 48 + .../datetime/date/DvDateYYYYMMDDImp.java | 43 + .../datetime/date/DvDateYYYYMMImp.java | 43 + .../datetime/DvDateTimeAttributes.java | 168 + .../datetime/time/DvTimeAttributes.java | 148 + .../datetime/time/DvTimeAttributesImp.java | 87 + .../datavalues/datetime/time/DvTimehhImp.java | 44 + .../datetime/time/DvTimehhmmImp.java | 41 + .../datetime/time/DvTimehhmmssImp.java | 39 + .../datetime/time/DvTimehhmmssfffImp.java | 39 + .../datavalues/datetime/time/PartialTime.java | 54 + .../datetime/time/StandardPartialTime.java | 47 + .../rawjson/LightRawJsonEncoder.java | 130 + .../rmobject/FeederAuditEncoding.java | 38 + .../dbencoding/rmobject/LinksEncoding.java | 52 + .../dbencoding/rmobject/RMObjectEncoding.java | 48 + .../dbencoding/rmobject/TemporalEncoding.java | 44 + .../wrappers/json/I_DvTypeAdapter.java | 47 + .../json/writer/CodePhraseAdapter.java | 72 + .../json/writer/DvCodedTextAdapter.java | 79 + .../wrappers/json/writer/DvDateAdapter.java | 66 + .../json/writer/DvDateTimeAdapter.java | 67 + .../json/writer/DvDurationAdapter.java | 61 + .../wrappers/json/writer/DvTextAdapter.java | 61 + .../wrappers/json/writer/DvTimeAdapter.java | 66 + .../wrappers/json/writer/DvTypeAdapter.java | 54 + .../json/writer/GenericIdAdapter.java | 55 + .../json/writer/HierObjectIdAdapter.java | 54 + .../json/writer/ParticipationAdapter.java | 73 + .../json/writer/PartyIdentifiedAdapter.java | 77 + .../wrappers/json/writer/PartyRefAdapter.java | 77 + .../json/writer/TermMappingAdapter.java | 63 + .../json/writer/TerminologyIDAdapter.java | 58 + .../translator_db2raw/ArchetypeNodeId.java | 45 + .../ArchieCompositionProlog.java | 53 + .../translator_db2raw/ArrayChildren.java | 55 + .../translator_db2raw/ArrayClosure.java | 48 + .../translator_db2raw/ArrayListAdapter.java | 69 + .../translator_db2raw/ArrayListPeek.java | 51 + .../writer/translator_db2raw/Children.java | 212 ++ .../translator_db2raw/CompositionRoot.java | 35 + .../translator_db2raw/DomainStructure.java | 55 + .../DvCodedTextNameValue.java | 96 + .../translator_db2raw/DvTextNameValue.java | 100 + .../writer/translator_db2raw/ElementType.java | 43 + .../translator_db2raw/EmbeddedValue.java | 60 + .../translator_db2raw/GenericRmType.java | 94 + .../translator_db2raw/I_NameValueHandler.java | 25 + .../IterativeItemStructure.java | 67 + .../LinkedTreeMapAdapter.java | 469 +++ .../writer/translator_db2raw/NameValue.java | 50 + .../json/writer/translator_db2raw/NodeId.java | 39 + .../json/writer/translator_db2raw/OptOut.java | 38 + .../RawJsonArchetypeNodeId.java | 41 + .../writer/translator_db2raw/RawJsonKey.java | 42 + .../writer/translator_db2raw/Siblings.java | 52 + .../translator_db2raw/ValueArrayList.java | 68 + .../exporter/v0/jooq/pg/DefaultCatalog.java | 63 + .../migration/exporter/v0/jooq/pg/Ehr.java | 1082 ++++++ .../exporter/v0/jooq/pg/Indexes.java | 247 ++ .../migration/exporter/v0/jooq/pg/Keys.java | 772 ++++ .../exporter/v0/jooq/pg/Routines.java | 3169 +++++++++++++++++ .../exporter/v0/jooq/pg/Sequences.java | 35 + .../migration/exporter/v0/jooq/pg/Tables.java | 985 +++++ .../migration/exporter/v0/jooq/pg/UDTs.java | 39 + .../jooq/pg/enums/ContributionChangeType.java | 74 + .../jooq/pg/enums/ContributionDataType.java | 72 + .../v0/jooq/pg/enums/ContributionState.java | 68 + .../exporter/v0/jooq/pg/enums/EntryType.java | 70 + .../v0/jooq/pg/enums/PartyRefIdType.java | 70 + .../exporter/v0/jooq/pg/enums/PartyType.java | 68 + .../pg/routines/AdminDeleteAllTemplates.java | 48 + .../jooq/pg/routines/AdminDeleteTemplate.java | 71 + .../jooq/pg/routines/AdminUpdateTemplate.java | 93 + .../pg/routines/AqlNodeNamePredicate.java | 117 + .../v0/jooq/pg/routines/CamelToSnake.java | 70 + .../v0/jooq/pg/routines/CompositionName.java | 71 + .../v0/jooq/pg/routines/CompositionUid.java | 94 + .../jooq/pg/routines/DeleteOrphanHistory.java | 48 + .../v0/jooq/pg/routines/EhrStatusUid.java | 93 + .../v0/jooq/pg/routines/FolderUid.java | 94 + .../v0/jooq/pg/routines/GetSystemVersion.java | 48 + .../v0/jooq/pg/routines/IsoTimestamp.java | 72 + .../jooq/pg/routines/JsArchetypeDetails1.java | 95 + .../jooq/pg/routines/JsArchetypeDetails2.java | 117 + .../v0/jooq/pg/routines/JsArchetyped.java | 92 + .../v0/jooq/pg/routines/JsAuditDetails.java | 72 + .../pg/routines/JsCanonicalDvQuantity.java | 137 + .../pg/routines/JsCanonicalGenericId.java | 93 + .../pg/routines/JsCanonicalHierObjectId1.java | 73 + .../pg/routines/JsCanonicalHierObjectId2.java | 73 + .../jooq/pg/routines/JsCanonicalObjectId.java | 119 + .../routines/JsCanonicalObjectVersionId.java | 73 + .../routines/JsCanonicalParticipations.java | 73 + .../routines/JsCanonicalPartyIdentified.java | 73 + .../jooq/pg/routines/JsCanonicalPartyRef.java | 135 + .../v0/jooq/pg/routines/JsCodePhrase1.java | 93 + .../v0/jooq/pg/routines/JsCodePhrase2.java | 77 + .../v0/jooq/pg/routines/JsComposition1.java | 73 + .../v0/jooq/pg/routines/JsComposition2.java | 95 + .../v0/jooq/pg/routines/JsConcept.java | 72 + .../v0/jooq/pg/routines/JsContext.java | 72 + .../v0/jooq/pg/routines/JsContextSetting.java | 72 + .../v0/jooq/pg/routines/JsContribution.java | 93 + .../v0/jooq/pg/routines/JsDvCodedText1.java | 93 + .../v0/jooq/pg/routines/JsDvCodedText2.java | 77 + .../jooq/pg/routines/JsDvCodedTextInner1.java | 77 + .../jooq/pg/routines/JsDvCodedTextInner2.java | 116 + .../v0/jooq/pg/routines/JsDvDateTime.java | 93 + .../v0/jooq/pg/routines/JsDvText.java | 71 + .../exporter/v0/jooq/pg/routines/JsEhr.java | 93 + .../v0/jooq/pg/routines/JsEhrStatus1.java | 73 + .../v0/jooq/pg/routines/JsEhrStatus2.java | 95 + .../v0/jooq/pg/routines/JsEhrStatusUid.java | 94 + .../v0/jooq/pg/routines/JsFolder.java | 95 + .../jooq/pg/routines/JsObjectVersionId.java | 72 + .../v0/jooq/pg/routines/JsParticipations.java | 73 + .../exporter/v0/jooq/pg/routines/JsParty.java | 72 + .../jooq/pg/routines/JsPartyIdentified.java | 92 + .../v0/jooq/pg/routines/JsPartyRef.java | 134 + .../v0/jooq/pg/routines/JsPartySelf.java | 72 + .../pg/routines/JsPartySelfIdentified.java | 92 + .../v0/jooq/pg/routines/JsTermMappings.java | 72 + .../jooq/pg/routines/JsTypedElementValue.java | 71 + .../v0/jooq/pg/routines/JsonEntryMigrate.java | 85 + .../pg/routines/JsonPartyIdentified1.java | 181 + .../pg/routines/JsonPartyIdentified2.java | 207 ++ .../v0/jooq/pg/routines/JsonPartyRelated.java | 232 ++ .../v0/jooq/pg/routines/JsonPartySelf.java | 185 + .../v0/jooq/pg/routines/JsonbExtractPath.java | 94 + .../pg/routines/JsonbExtractPathText.java | 94 + .../routines/MapChangeTypeToCodestring.java | 71 + .../routines/MigrateConceptToDvCodedText.java | 81 + .../jooq/pg/routines/MigrateFolderAudit.java | 55 + .../MigrateParticipationFunction.java | 78 + .../pg/routines/MigrateParticipationMode.java | 77 + .../pg/routines/MigrationAuditCommitter.java | 72 + .../pg/routines/MigrationAuditSystemId.java | 72 + .../jooq/pg/routines/MigrationAuditTzid.java | 72 + .../v0/jooq/pg/routines/NextSysTenant.java | 48 + .../v0/jooq/pg/routines/ObjectVersionId.java | 114 + .../v0/jooq/pg/routines/PartyRef.java | 163 + .../v0/jooq/pg/routines/PartyUsage.java | 72 + .../exporter/v0/jooq/pg/tables/Access.java | 225 ++ .../pg/tables/AdminDeleteAttestation.java | 183 + .../v0/jooq/pg/tables/AdminDeleteAudit.java | 186 + .../pg/tables/AdminDeleteComposition.java | 210 ++ .../tables/AdminDeleteCompositionHistory.java | 188 + .../pg/tables/AdminDeleteContribution.java | 189 + .../v0/jooq/pg/tables/AdminDeleteEhr.java | 193 + .../v0/jooq/pg/tables/AdminDeleteEhrFull.java | 181 + .../jooq/pg/tables/AdminDeleteEhrHistory.java | 183 + .../AdminDeleteEventContextForCompo.java | 195 + .../v0/jooq/pg/tables/AdminDeleteStatus.java | 194 + .../pg/tables/AdminDeleteStatusHistory.java | 183 + .../jooq/pg/tables/AdminDeleteTenantFull.java | 182 + .../pg/tables/AdminGetLinkedCompositions.java | 184 + .../AdminGetLinkedCompositionsForContrib.java | 193 + .../tables/AdminGetLinkedContributions.java | 190 + .../AdminGetLinkedStatusForContrib.java | 189 + .../jooq/pg/tables/AdminGetTemplateUsage.java | 183 + .../v0/jooq/pg/tables/Attestation.java | 286 ++ .../v0/jooq/pg/tables/AttestationRef.java | 204 ++ .../v0/jooq/pg/tables/AttestedView.java | 306 ++ .../v0/jooq/pg/tables/AuditDetails.java | 298 ++ .../v0/jooq/pg/tables/CompExpand.java | 332 ++ .../exporter/v0/jooq/pg/tables/CompoXref.java | 245 ++ .../v0/jooq/pg/tables/Composition.java | 442 +++ .../v0/jooq/pg/tables/CompositionHistory.java | 343 ++ .../exporter/v0/jooq/pg/tables/Concept.java | 229 ++ .../v0/jooq/pg/tables/Contribution.java | 303 ++ .../exporter/v0/jooq/pg/tables/Ehr.java | 268 ++ .../exporter/v0/jooq/pg/tables/EhrFolder.java | 380 ++ .../v0/jooq/pg/tables/EhrFolderHistory.java | 399 +++ .../exporter/v0/jooq/pg/tables/EhrStatus.java | 274 ++ .../exporter/v0/jooq/pg/tables/Entry.java | 377 ++ .../v0/jooq/pg/tables/EntryHistory.java | 345 ++ .../v0/jooq/pg/tables/EventContext.java | 371 ++ .../jooq/pg/tables/EventContextHistory.java | 330 ++ .../jooq/pg/tables/FlywaySchemaHistory.java | 267 ++ .../exporter/v0/jooq/pg/tables/Heading.java | 214 ++ .../v0/jooq/pg/tables/Identifier.java | 264 ++ .../v0/jooq/pg/tables/JsonbArrayElements.java | 181 + .../exporter/v0/jooq/pg/tables/Language.java | 179 + .../v0/jooq/pg/tables/Participation.java | 363 ++ .../jooq/pg/tables/ParticipationHistory.java | 323 ++ .../v0/jooq/pg/tables/PartyIdentified.java | 306 ++ .../pg/tables/PartyUsageIdentification.java | 189 + .../exporter/v0/jooq/pg/tables/Plugin.java | 203 ++ .../v0/jooq/pg/tables/SessionLog.java | 264 ++ .../exporter/v0/jooq/pg/tables/Status.java | 428 +++ .../v0/jooq/pg/tables/StatusHistory.java | 344 ++ .../v0/jooq/pg/tables/StoredQuery.java | 285 ++ .../exporter/v0/jooq/pg/tables/System.java | 199 ++ .../v0/jooq/pg/tables/TemplateStore.java | 232 ++ .../exporter/v0/jooq/pg/tables/Tenant.java | 206 ++ .../jooq/pg/tables/TerminologyProvider.java | 222 ++ .../exporter/v0/jooq/pg/tables/Territory.java | 203 ++ .../exporter/v0/jooq/pg/tables/Users.java | 219 ++ .../jooq/pg/tables/XjsonbArrayElements.java | 181 + .../jooq/pg/tables/records/AccessRecord.java | 232 ++ .../records/AdminDeleteAttestationRecord.java | 111 + .../records/AdminDeleteAuditRecord.java | 147 + .../AdminDeleteCompositionHistoryRecord.java | 110 + .../records/AdminDeleteCompositionRecord.java | 259 ++ .../AdminDeleteContributionRecord.java | 148 + .../records/AdminDeleteEhrFullRecord.java | 109 + .../records/AdminDeleteEhrHistoryRecord.java | 110 + .../tables/records/AdminDeleteEhrRecord.java | 185 + ...AdminDeleteEventContextForCompoRecord.java | 148 + .../AdminDeleteStatusHistoryRecord.java | 110 + .../records/AdminDeleteStatusRecord.java | 185 + .../records/AdminDeleteTenantFullRecord.java | 110 + ...GetLinkedCompositionsForContribRecord.java | 113 + .../AdminGetLinkedCompositionsRecord.java | 111 + .../AdminGetLinkedContributionsRecord.java | 148 + .../AdminGetLinkedStatusForContribRecord.java | 111 + .../records/AdminGetTemplateUsageRecord.java | 110 + .../pg/tables/records/AttestationRecord.java | 345 ++ .../tables/records/AttestationRefRecord.java | 156 + .../pg/tables/records/AttestedViewRecord.java | 513 +++ .../pg/tables/records/AuditDetailsRecord.java | 398 +++ .../pg/tables/records/CompExpandRecord.java | 469 +++ .../pg/tables/records/CompoXrefRecord.java | 222 ++ .../records/CompositionHistoryRecord.java | 709 ++++ .../pg/tables/records/CompositionRecord.java | 719 ++++ .../jooq/pg/tables/records/ConceptRecord.java | 232 ++ .../pg/tables/records/ContributionRecord.java | 359 ++ .../records/EhrFolderHistoryRecord.java | 844 +++++ .../pg/tables/records/EhrFolderRecord.java | 760 ++++ .../v0/jooq/pg/tables/records/EhrRecord.java | 308 ++ .../pg/tables/records/EhrStatusRecord.java | 503 +++ .../pg/tables/records/EntryHistoryRecord.java | 669 ++++ .../jooq/pg/tables/records/EntryRecord.java | 679 ++++ .../records/EventContextHistoryRecord.java | 626 ++++ .../pg/tables/records/EventContextRecord.java | 636 ++++ .../records/FlywaySchemaHistoryRecord.java | 474 +++ .../jooq/pg/tables/records/HeadingRecord.java | 231 ++ .../pg/tables/records/IdentifierRecord.java | 299 ++ .../records/JsonbArrayElementsRecord.java | 110 + .../pg/tables/records/LanguageRecord.java | 156 + .../records/ParticipationHistoryRecord.java | 583 +++ .../tables/records/ParticipationRecord.java | 593 +++ .../tables/records/PartyIdentifiedRecord.java | 480 +++ .../PartyUsageIdentificationRecord.java | 148 + .../jooq/pg/tables/records/PluginRecord.java | 231 ++ .../pg/tables/records/SessionLogRecord.java | 397 +++ .../tables/records/StatusHistoryRecord.java | 668 ++++ .../jooq/pg/tables/records/StatusRecord.java | 678 ++++ .../pg/tables/records/StoredQueryRecord.java | 351 ++ .../jooq/pg/tables/records/SystemRecord.java | 194 + .../tables/records/TemplateStoreRecord.java | 270 ++ .../jooq/pg/tables/records/TenantRecord.java | 231 ++ .../records/TerminologyProviderRecord.java | 231 ++ .../pg/tables/records/TerritoryRecord.java | 231 ++ .../jooq/pg/tables/records/UsersRecord.java | 194 + .../records/XjsonbArrayElementsRecord.java | 110 + .../exporter/v0/jooq/pg/udt/CodePhrase.java | 73 + .../exporter/v0/jooq/pg/udt/DvCodedText.java | 107 + .../jooq/pg/udt/records/CodePhraseRecord.java | 146 + .../pg/udt/records/DvCodedTextRecord.java | 307 ++ .../importer/v4/AuditDetailsTargetType.java | 35 + .../migration/importer/v4/AuditImporter.java | 106 + .../importer/v4/ContributionImporter.java | 68 + .../migration/importer/v4/EhrImporter.java | 55 + .../importer/v4/EhrSchemaDataImporter.java | 80 + .../importer/v4/EhrSchemaImporter.java | 111 + .../migration/importer/v4/FlywayConfig.java | 39 + .../migration/importer/v4/FlywayService.java | 94 + .../migration/importer/v4/ImportService.java | 77 + .../importer/v4/ImportServiceImpl.java | 60 + .../importer/v4/LocatableImporter.java | 261 ++ .../importer/v4/jooq/pg/DefaultCatalog.java | 63 + .../migration/importer/v4/jooq/pg/Ehr.java | 203 ++ .../importer/v4/jooq/pg/Indexes.java | 76 + .../migration/importer/v4/jooq/pg/Keys.java | 494 +++ .../importer/v4/jooq/pg/Sequences.java | 35 + .../migration/importer/v4/jooq/pg/Tables.java | 148 + .../jooq/pg/enums/ContributionChangeType.java | 74 + .../jooq/pg/enums/ContributionDataType.java | 72 + .../v4/jooq/pg/enums/ContributionState.java | 68 + .../v4/jooq/pg/tables/AuditDetails.java | 257 ++ .../importer/v4/jooq/pg/tables/CompData.java | 305 ++ .../v4/jooq/pg/tables/CompDataHistory.java | 323 ++ .../v4/jooq/pg/tables/CompVersion.java | 303 ++ .../v4/jooq/pg/tables/CompVersionHistory.java | 313 ++ .../v4/jooq/pg/tables/Contribution.java | 258 ++ .../importer/v4/jooq/pg/tables/Ehr.java | 181 + .../v4/jooq/pg/tables/EhrFolderData.java | 346 ++ .../jooq/pg/tables/EhrFolderDataHistory.java | 358 ++ .../v4/jooq/pg/tables/EhrFolderVersion.java | 276 ++ .../pg/tables/EhrFolderVersionHistory.java | 297 ++ .../v4/jooq/pg/tables/EhrStatusData.java | 335 ++ .../jooq/pg/tables/EhrStatusDataHistory.java | 348 ++ .../v4/jooq/pg/tables/EhrStatusVersion.java | 275 ++ .../pg/tables/EhrStatusVersionHistory.java | 289 ++ .../jooq/pg/tables/FlywaySchemaHistory.java | 269 ++ .../importer/v4/jooq/pg/tables/Plugin.java | 202 ++ .../v4/jooq/pg/tables/StoredQuery.java | 230 ++ .../v4/jooq/pg/tables/TemplateStore.java | 204 ++ .../importer/v4/jooq/pg/tables/Users.java | 188 + .../pg/tables/records/AuditDetailsRecord.java | 360 ++ .../tables/records/CompDataHistoryRecord.java | 675 ++++ .../pg/tables/records/CompDataRecord.java | 607 ++++ .../records/CompVersionHistoryRecord.java | 475 +++ .../pg/tables/records/CompVersionRecord.java | 397 +++ .../pg/tables/records/ContributionRecord.java | 272 ++ .../records/EhrFolderDataHistoryRecord.java | 759 ++++ .../tables/records/EhrFolderDataRecord.java | 717 ++++ .../EhrFolderVersionHistoryRecord.java | 436 +++ .../records/EhrFolderVersionRecord.java | 352 ++ .../v4/jooq/pg/tables/records/EhrRecord.java | 158 + .../records/EhrStatusDataHistoryRecord.java | 717 ++++ .../tables/records/EhrStatusDataRecord.java | 675 ++++ .../EhrStatusVersionHistoryRecord.java | 397 +++ .../records/EhrStatusVersionRecord.java | 314 ++ .../records/FlywaySchemaHistoryRecord.java | 476 +++ .../jooq/pg/tables/records/PluginRecord.java | 231 ++ .../pg/tables/records/StoredQueryRecord.java | 313 ++ .../tables/records/TemplateStoreRecord.java | 233 ++ .../jooq/pg/tables/records/UsersRecord.java | 157 + .../org/ehrbase/migration/service/Batch.java | 71 + .../migration/service/FileService.java | 170 + .../migration/service/ProcessService.java | 229 ++ service/src/main/resources/application.yml | 28 + .../ehr/V10__ehr_status_subject_aql_idx.sql | 27 + .../db/migration/ehr/V11__drop_system.sql | 20 + .../ehr/V12__drop_template_index.sql | 19 + .../ehr/V13__refactor_audit_details.sql | 43 + .../ehr/V14__index_for_ehr_time_created.sql | 20 + .../resources/db/migration/ehr/V1__ehr.sql | 199 ++ .../resources/db/migration/ehr/V2__tenant.sql | 20 + .../db/migration/ehr/V3__locatable.sql | 273 ++ .../migration/ehr/V4__drop_comp_data_idx.sql | 19 + .../ehr/V5_1__remove_multi_tenancy.sql | 96 + .../ehr/V5_2__remove_multi_tenancy.sql | 51 + .../ehr/V5_3__remove_multi_tenancy.sql | 57 + .../ehr/V5_4__remove_multi_tenancy.sql | 22 + .../db/migration/ehr/V6_1__version_tables.sql | 109 + .../db/migration/ehr/V6_2__version_tables.sql | 139 + .../db/migration/ehr/V6_3__version_tables.sql | 132 + .../db/migration/ehr/V6_4__version_tables.sql | 57 + .../migration/ehr/V7__comp_rmobject_index.sql | 20 + .../db/migration/ehr/V8__vo_data_indexes.sql | 44 + ...V9_1__add_root_concept_to_comp_version.sql | 20 + ...V9_2__add_root_concept_to_comp_version.sql | 26 + ...V9_3__add_root_concept_to_comp_version.sql | 24 + .../db/migration/ext/V1__baseline.sql | 19 + .../migration/ext/V2__aggregate_functions.sql | 153 + .../V3__dv_ordered_aggregate_functions.sql | 108 + .../ext/V4__create_missing_collation.sql | 20 + .../ehrbase/migration/service/BatchTest.java | 65 + spotless-lic-header | 17 + 451 files changed, 84312 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build-and-push.yml create mode 100644 application/pom.xml create mode 100644 application/src/main/java/org/ehrbase/migration/application/MigrationTool.java create mode 100644 application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerNew.java create mode 100644 application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerOld.java create mode 100644 application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresNewContainer.java create mode 100644 application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresOldContainer.java create mode 100644 application/src/test/java/org/ehrbase/migration/application/KeycloakMockContainer.java create mode 100644 application/src/test/java/org/ehrbase/migration/application/MigrationToolTestIT.java create mode 100644 application/src/test/resources/conformance_ehrbase.de.v0.opt create mode 100644 application/src/test/resources/conformance_ehrbase.de.v0_composition.json create mode 100644 bom/pom.xml create mode 100644 pom.xml create mode 100644 service/pom.xml create mode 100644 service/src/main/java/org/ehrbase/migration/MigrationUtils.java create mode 100644 service/src/main/java/org/ehrbase/migration/config/ExportDatasourceConfiguration.java create mode 100644 service/src/main/java/org/ehrbase/migration/config/ImportDatasourceConfiguration.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/EhrSchema.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/EhrSchemaData.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/ExtendedEhr.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/SetToSortedSetConverter.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/System.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/User.java create mode 100644 service/src/main/java/org/ehrbase/migration/dto/VersionedObjectData.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/ExportService.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/ExportServiceConfiguration.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/postprocessor/EhrStatusPostprocessor.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ExportPostprocessor.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/postprocessor/PostprocessorConfiguration.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ValidationPostprocessor.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/AuditExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/CompositionExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/ContributionExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/EhrExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/EhrSchemaDataExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/EhrStatusExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/ExportServiceV0Imp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/FolderExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/PartyExporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/OtherDetailsJsonbBinder.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/SysPeriodBinder.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositeClassName.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositionSerializer.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ElementValue.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/Elements.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EncodeUtilArchie.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EntrySerialTree.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ItemStack.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/MultiMap.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameAsDvText.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameInMap.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NodeEncoding.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathItem.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathMap.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RawJson.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RmObjectEncoding.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SerialTree.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SimpleClassName.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActionAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActivityAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/AdminEntryAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/CareEntryAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ClusterAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ContentItemAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/DataStructureAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ElementAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EntryAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EvaluationAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EventAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditDetailsAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/HistoryAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/I_SubjectAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionDetailsAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/IsmTransitionAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemStructureAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LinksAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LocatableAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ObservationAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/OtherParticipationAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyIdentifiedAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyRelatedAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartySelfAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/RMAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SectionAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SubjectAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateTimeAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_PartialTime.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TemporalAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TimeAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/TemporalAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributesImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMDDImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/datetime/DvDateTimeAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributesImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssfffImp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/PartialTime.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/StandardPartialTime.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rawjson/LightRawJsonEncoder.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/FeederAuditEncoding.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/LinksEncoding.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/RMObjectEncoding.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/TemporalEncoding.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/I_DvTypeAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/CodePhraseAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvCodedTextAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateTimeAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDurationAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTextAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTimeAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTypeAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/GenericIdAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/HierObjectIdAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/ParticipationAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyIdentifiedAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyRefAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TermMappingAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TerminologyIDAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchetypeNodeId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchieCompositionProlog.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayChildren.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayClosure.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListPeek.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Children.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/CompositionRoot.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DomainStructure.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvCodedTextNameValue.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvTextNameValue.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ElementType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/EmbeddedValue.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/GenericRmType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/I_NameValueHandler.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/IterativeItemStructure.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/LinkedTreeMapAdapter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NameValue.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NodeId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/OptOut.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonArchetypeNodeId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonKey.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Siblings.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ValueArrayList.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/DefaultCatalog.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Ehr.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Indexes.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Keys.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Routines.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Sequences.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Tables.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/UDTs.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionChangeType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionDataType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionState.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/EntryType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyRefIdType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyType.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteAllTemplates.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteTemplate.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminUpdateTemplate.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AqlNodeNamePredicate.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CamelToSnake.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionName.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionUid.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/DeleteOrphanHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/EhrStatusUid.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/FolderUid.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/GetSystemVersion.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/IsoTimestamp.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetyped.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsAuditDetails.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalDvQuantity.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalGenericId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectVersionId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalParticipations.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyIdentified.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyRef.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsConcept.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContext.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContextSetting.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContribution.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvDateTime.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvText.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhr.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatusUid.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsFolder.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsObjectVersionId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParticipations.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParty.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyIdentified.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyRef.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelf.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelfIdentified.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTermMappings.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTypedElementValue.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonEntryMigrate.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified1.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified2.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyRelated.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartySelf.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPath.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPathText.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MapChangeTypeToCodestring.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateConceptToDvCodedText.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateFolderAudit.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationFunction.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationMode.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditCommitter.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditSystemId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditTzid.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/NextSysTenant.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/ObjectVersionId.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyRef.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyUsage.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Access.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAttestation.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAudit.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteComposition.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteCompositionHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteContribution.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhr.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrFull.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEventContextForCompo.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatus.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatusHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteTenantFull.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositions.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositionsForContrib.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedContributions.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedStatusForContrib.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetTemplateUsage.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Attestation.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestationRef.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestedView.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AuditDetails.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompExpand.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompoXref.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Composition.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompositionHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Concept.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Contribution.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Ehr.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolder.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolderHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrStatus.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Entry.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EntryHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContext.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContextHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/FlywaySchemaHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Heading.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Identifier.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/JsonbArrayElements.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Language.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Participation.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/ParticipationHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyIdentified.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyUsageIdentification.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Plugin.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/SessionLog.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Status.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StatusHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StoredQuery.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/System.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TemplateStore.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Tenant.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TerminologyProvider.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Territory.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Users.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/XjsonbArrayElements.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AccessRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAttestationRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAuditRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteContributionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrFullRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEventContextForCompoRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteTenantFullRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsForContribRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedContributionsRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedStatusForContribRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetTemplateUsageRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRefRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestedViewRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AuditDetailsRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompExpandRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompoXrefRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ConceptRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ContributionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrStatusRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/HeadingRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/IdentifierRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/JsonbArrayElementsRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/LanguageRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyIdentifiedRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyUsageIdentificationRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PluginRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SessionLogRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StoredQueryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SystemRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TemplateStoreRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TenantRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerminologyProviderRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerritoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/UsersRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/XjsonbArrayElementsRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/CodePhrase.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/DvCodedText.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/CodePhraseRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/DvCodedTextRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/AuditDetailsTargetType.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/AuditImporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/ContributionImporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/EhrImporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaDataImporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaImporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/FlywayConfig.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/FlywayService.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/ImportService.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/ImportServiceImpl.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/LocatableImporter.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/DefaultCatalog.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Ehr.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Indexes.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Keys.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Sequences.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Tables.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionChangeType.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionDataType.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionState.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/AuditDetails.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompData.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompDataHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersion.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersionHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Contribution.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Ehr.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderData.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderDataHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersion.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersionHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusData.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusDataHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersion.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersionHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/FlywaySchemaHistory.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Plugin.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/StoredQuery.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/TemplateStore.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Users.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/AuditDetailsRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/ContributionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/PluginRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/StoredQueryRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/TemplateStoreRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/UsersRecord.java create mode 100644 service/src/main/java/org/ehrbase/migration/service/Batch.java create mode 100644 service/src/main/java/org/ehrbase/migration/service/FileService.java create mode 100644 service/src/main/java/org/ehrbase/migration/service/ProcessService.java create mode 100644 service/src/main/resources/application.yml create mode 100644 service/src/main/resources/db/migration/ehr/V10__ehr_status_subject_aql_idx.sql create mode 100644 service/src/main/resources/db/migration/ehr/V11__drop_system.sql create mode 100644 service/src/main/resources/db/migration/ehr/V12__drop_template_index.sql create mode 100644 service/src/main/resources/db/migration/ehr/V13__refactor_audit_details.sql create mode 100644 service/src/main/resources/db/migration/ehr/V14__index_for_ehr_time_created.sql create mode 100644 service/src/main/resources/db/migration/ehr/V1__ehr.sql create mode 100644 service/src/main/resources/db/migration/ehr/V2__tenant.sql create mode 100644 service/src/main/resources/db/migration/ehr/V3__locatable.sql create mode 100644 service/src/main/resources/db/migration/ehr/V4__drop_comp_data_idx.sql create mode 100644 service/src/main/resources/db/migration/ehr/V5_1__remove_multi_tenancy.sql create mode 100644 service/src/main/resources/db/migration/ehr/V5_2__remove_multi_tenancy.sql create mode 100644 service/src/main/resources/db/migration/ehr/V5_3__remove_multi_tenancy.sql create mode 100644 service/src/main/resources/db/migration/ehr/V5_4__remove_multi_tenancy.sql create mode 100644 service/src/main/resources/db/migration/ehr/V6_1__version_tables.sql create mode 100644 service/src/main/resources/db/migration/ehr/V6_2__version_tables.sql create mode 100644 service/src/main/resources/db/migration/ehr/V6_3__version_tables.sql create mode 100644 service/src/main/resources/db/migration/ehr/V6_4__version_tables.sql create mode 100644 service/src/main/resources/db/migration/ehr/V7__comp_rmobject_index.sql create mode 100644 service/src/main/resources/db/migration/ehr/V8__vo_data_indexes.sql create mode 100644 service/src/main/resources/db/migration/ehr/V9_1__add_root_concept_to_comp_version.sql create mode 100644 service/src/main/resources/db/migration/ehr/V9_2__add_root_concept_to_comp_version.sql create mode 100644 service/src/main/resources/db/migration/ehr/V9_3__add_root_concept_to_comp_version.sql create mode 100644 service/src/main/resources/db/migration/ext/V1__baseline.sql create mode 100644 service/src/main/resources/db/migration/ext/V2__aggregate_functions.sql create mode 100644 service/src/main/resources/db/migration/ext/V3__dv_ordered_aggregate_functions.sql create mode 100644 service/src/main/resources/db/migration/ext/V4__create_missing_collation.sql create mode 100644 service/src/test/java/org/ehrbase/migration/service/BatchTest.java create mode 100644 spotless-lic-header diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7470eab --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "maven" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml new file mode 100644 index 0000000..db25f90 --- /dev/null +++ b/.github/workflows/build-and-push.yml @@ -0,0 +1,73 @@ +name: Build and push + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '21' ] + + steps: + # Install the migration tool in the local repo + - name: Checkout Migration Tool + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ehrbase/migration-tool + ref: develop + # This will be used by git in all further steps + # We need a PERSONAL ACCESS TOKEN so pushes trigger other github actions + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Install Migration Tool + run: mvn install + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Login to GitLab + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + - name: Spotless + run: mvn spotless:check + - name: install migration tool main + run: mvn install -Dmaven.test.skip=true + + + - name: Build with Maven + run: mvn clean verify spring-boot:build-image + + - name: Build and push + if: ${{ github.ref == 'ref/head/develop' }} || ${{ github.ref == 'ref/head/master' }} || ${{ github.ref == 'ref/head/main' }} + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + docker push ehrbase/migration-tool:${VERSION} + diff --git a/LICENSE b/LICENSE index 261eeb9..797893e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 vitasystems GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/application/pom.xml b/application/pom.xml new file mode 100644 index 0000000..eb51153 --- /dev/null +++ b/application/pom.xml @@ -0,0 +1,208 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + + org.ehrbase.migration + migration-application + 1.1.0-SNAPSHOT + jar + EHRbase Migration Tool Application + + + dockerhub.io/ehrbase/migration-tool + ${project.version} + 21 + 21 + 21 + + + + + + org.ehrbase.migration + migration-bom + ${project.version} + pom + import + + + + + + + + + org.ehrbase.migration + migration-service + ${project.version} + + + org.springframework.boot + spring-boot-starter-test + + + org.testcontainers + junit-jupiter + + + org.wiremock + wiremock + + + io.jsonwebtoken + jjwt-impl + + + io.jsonwebtoken + jjwt-jackson + + + org.mock-server + mockserver-junit-jupiter + + + com.nimbusds + nimbus-jose-jwt + + + + + migration-tool + + + org.apache.maven.plugins + maven-compiler-plugin + + + -parameters + + + + + com.diffplug.spotless + spotless-maven-plugin + 2.43.0 + + + + @format:off + @format:on + + + 2.40.0 + + + ../spotless-lic-header + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + org.ehrbase.migration.application.MigrationTool + + ${image.name}:${image.tag} + + true + + + false + + + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + agent for unit tests + + prepare-agent + + + surefireArgLine + + + + + agent for integration tests + + prepare-agent-integration + + + failsafeArgLine + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{surefireArgLine} + + + + test + + test + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + integration-test + verify + + integration-test + verify + + + + @{failsafeArgLine} + + **/*IT.java + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + diff --git a/application/src/main/java/org/ehrbase/migration/application/MigrationTool.java b/application/src/main/java/org/ehrbase/migration/application/MigrationTool.java new file mode 100644 index 0000000..aa04550 --- /dev/null +++ b/application/src/main/java/org/ehrbase/migration/application/MigrationTool.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import org.ehrbase.migration.service.ProcessService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.context.ConfigurableApplicationContext; + +@SpringBootApplication(scanBasePackages = "org.ehrbase.migration") +public class MigrationTool implements CommandLineRunner { + + public enum MigrationMode { + DB2DB, + IMPORT, + EXPORT, + NONE + } + + @Value("${mode}") + private MigrationMode mode; + + @Value("${terminate:true}") + private boolean terminate; + + private static Logger LOG = LoggerFactory.getLogger(MigrationTool.class); + + private final ConfigurableApplicationContext context; + + private final ProcessService processService; + + public MigrationTool(ProcessService processService, ConfigurableApplicationContext context) { + this.processService = processService; + this.context = context; + } + + public static void main(String[] args) { + LOG.info("STARTING THE APPLICATION"); + new SpringApplicationBuilder(MigrationTool.class) + .web(WebApplicationType.NONE) + .run(args); + } + + @Override + public void run(String... args) { + + switch (mode) { + case DB2DB -> processService.db2db(); + case IMPORT -> processService.importFromFile(); + case EXPORT -> processService.exportToFile(); + case NONE -> LOG.info("Migration mode NONE: Skipping"); + } + if (terminate) { + LOG.debug("Shutting down"); + int exitCode = SpringApplication.exit(context); + LOG.info("APPLICATION FINISHED"); + System.exit(exitCode); + } + } +} diff --git a/application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerNew.java b/application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerNew.java new file mode 100644 index 0000000..ac170fd --- /dev/null +++ b/application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerNew.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import static java.time.temporal.ChronoUnit.SECONDS; + +import java.time.Duration; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; +import org.testcontainers.lifecycle.Startable; + +@SuppressWarnings({"rawtypes", "unchecked"}) +public class EHRbaseContainerNew extends GenericContainer { + + public static final Integer PORT = 8080; + + protected static final String EHRBASE_ADMIN_USER = "ehrbase"; + + protected static final String EHRBASE_ADMIN_PASSWORD = "ehrbase"; + + protected static final String EHRBASE_USER = "ehrbase_restricted"; + + protected static final String EHRBASE_PASSWORD = "ehrbase_restricted"; + + private static final String IMAGE = "ehrbase/ehrbase:2.0.0"; + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + public EHRbaseContainerNew(Network network, List startables) { + super(IMAGE); + withNetwork(network); + waitingFor(new LogMessageWaitStrategy() + .withRegEx(".*Started EhrBase in .*\\s") + .withTimes(1) + .withStartupTimeout(Duration.of(120, SECONDS))); + addExposedPort(PORT); + dependsOn(startables); + withLogConsumer(new Slf4jLogConsumer(log)); + } + + @Override + protected void configure() { + addEnv( + "SPRING_DATASOURCE_URL", + "jdbc:postgresql://%s:%s/ehrbase" + .formatted(EHRbasePostgresNewContainer.CONTAINER_NAME, EHRbasePostgresNewContainer.PORT)); + addEnv("DB_USER_ADMIN", EHRBASE_ADMIN_USER); + addEnv("DB_PASS_ADMIN", EHRBASE_ADMIN_PASSWORD); + addEnv("DB_USER", EHRBASE_USER); + addEnv("DB_PASS", EHRBASE_PASSWORD); + addEnv("EHRBASE_DBMSPROVIDER", "POSTGRES"); + addEnv("SECURITY_AUTHTYPE", "OAUTH"); + addEnv("SECURITY_OAUTH2USERROLE", "hcp"); + addEnv( + "SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUERURI", + "http://%s:%s/auth/realms/master" + .formatted(KeycloakMockContainer.CONTAINER_NAME, KeycloakMockContainer.PORT)); + } +} diff --git a/application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerOld.java b/application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerOld.java new file mode 100644 index 0000000..ee91fca --- /dev/null +++ b/application/src/test/java/org/ehrbase/migration/application/EHRbaseContainerOld.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import static java.time.temporal.ChronoUnit.SECONDS; + +import java.time.Duration; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; +import org.testcontainers.lifecycle.Startable; + +@SuppressWarnings({"rawtypes", "unchecked"}) +public class EHRbaseContainerOld extends GenericContainer { + + public static final Integer PORT = 8080; + + protected static final String EHRBASE_ADMIN_USER = "ehrbase"; + + protected static final String EHRBASE_ADMIN_PASSWORD = "ehrbase"; + + protected static final String EHRBASE_USER = "ehrbase_restricted"; + + protected static final String EHRBASE_PASSWORD = "ehrbase_restricted"; + + private static final String IMAGE = "ehrbase/ehrbase:0.32.0"; + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + public EHRbaseContainerOld(Network network, List startables) { + super(IMAGE); + withNetwork(network); + waitingFor(new LogMessageWaitStrategy() + .withRegEx(".*Started EhrBase in .*\\s") + .withTimes(1) + .withStartupTimeout(Duration.of(120, SECONDS))); + addExposedPort(PORT); + dependsOn(startables); + withLogConsumer(new Slf4jLogConsumer(log)); + } + + @Override + protected void configure() { + addEnv( + "SPRING_DATASOURCE_URL", + "jdbc:postgresql://%s:%s/ehrbase" + .formatted(EHRbasePostgresOldContainer.CONTAINER_NAME, EHRbasePostgresOldContainer.PORT)); + addEnv("DB_USER_ADMIN", EHRBASE_ADMIN_USER); + addEnv("DB_PASS_ADMIN", EHRBASE_ADMIN_PASSWORD); + addEnv("DB_USER", EHRBASE_USER); + addEnv("DB_PASS", EHRBASE_PASSWORD); + addEnv("SECURITY_AUTHTYPE", "OAUTH"); + addEnv("SECURITY_OAUTH2USERROLE", "hcp"); + addEnv( + "SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUERURI", + "http://%s:%s/auth/realms/master" + .formatted(KeycloakMockContainer.CONTAINER_NAME, KeycloakMockContainer.PORT)); + } +} diff --git a/application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresNewContainer.java b/application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresNewContainer.java new file mode 100644 index 0000000..6c8473f --- /dev/null +++ b/application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresNewContainer.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import static java.time.temporal.ChronoUnit.SECONDS; + +import java.time.Duration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; + +/** + * A postgres testcontainer tailored for the worker service needs. Using this container in a test will setup postgres with the + * following settings: + * + *
+ *   databases:
+ *    - "postgres": db for the mappings
+ *    - "ehrbase": db for ehrbase
+ *    users:
+ *    - "postgres": mapping user
+ *    - "ehrbase": ehrbase user
+ *    password:
+ *    - "postgres": mapping password
+ *    - "ehrbase": ehrbase password
+ * 
+ */ +@SuppressWarnings({"rawtypes", "unchecked"}) +public class EHRbasePostgresNewContainer extends GenericContainer { + + public static final Integer PORT = 5432; + public static final String CONTAINER_NAME = "new_postgres"; + private static final String IMAGE = "ehrbase/ehrbase-v2-postgres:16.2"; + private static final String POSTGRES_MAPPING_USER = "postgres"; + private static final String POSTGRES_MAPPING_PW = "postgres"; + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + public EHRbasePostgresNewContainer(Network network) { + super(IMAGE); + + withNetwork(network); + + // Wait 2 times for the given log message cause after the init script was executed this message + // will be displayed again and only then the postgres is finally ready. + waitingFor(new LogMessageWaitStrategy() + .withRegEx(".*database system is ready to accept connections.*\\s") + .withTimes(2) + .withStartupTimeout(Duration.of(60, SECONDS))); + + addExposedPort(PORT); + + withNetworkAliases(CONTAINER_NAME); + + withLogConsumer(new Slf4jLogConsumer(log)); + } + + @Override + protected void configure() { + addEnv("POSTGRES_USER", POSTGRES_MAPPING_USER); + addEnv("POSTGRES_PASSWORD", POSTGRES_MAPPING_PW); + addEnv("EHRBASE_USER_ADMIN", EHRbaseContainerOld.EHRBASE_ADMIN_USER); + addEnv("EHRBASE_PASSWORD_ADMIN", EHRbaseContainerOld.EHRBASE_ADMIN_USER); + addEnv("EHRBASE_USER", EHRbaseContainerOld.EHRBASE_USER); + addEnv("EHRBASE_PASSWORD", EHRbaseContainerOld.EHRBASE_PASSWORD); + } +} diff --git a/application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresOldContainer.java b/application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresOldContainer.java new file mode 100644 index 0000000..8c3410f --- /dev/null +++ b/application/src/test/java/org/ehrbase/migration/application/EHRbasePostgresOldContainer.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import static java.time.temporal.ChronoUnit.SECONDS; + +import java.time.Duration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; + +/** + * A postgres testcontainer tailored for the worker service needs. Using this container in a test will setup postgres with the + * following settings: + * + *
+ *   databases:
+ *    - "postgres": db for the mappings
+ *    - "ehrbase": db for ehrbase
+ *    users:
+ *    - "postgres": mapping user
+ *    - "ehrbase": ehrbase user
+ *    password:
+ *    - "postgres": mapping password
+ *    - "ehrbase": ehrbase password
+ * 
+ */ +@SuppressWarnings({"rawtypes", "unchecked"}) +public class EHRbasePostgresOldContainer extends GenericContainer { + + public static final Integer PORT = 5432; + public static final String CONTAINER_NAME = "old_postgres"; + private static final String IMAGE = "ehrbase/ehrbase-postgres:13.4.v2"; + private static final String POSTGRES_MAPPING_USER = "postgres"; + private static final String POSTGRES_MAPPING_PW = "postgres"; + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + public EHRbasePostgresOldContainer(Network network) { + super(IMAGE); + + withNetwork(network); + + // Wait 2 times for the given log message cause after the init script was executed this message + // will be displayed again and only then the postgres is finally ready. + waitingFor(new LogMessageWaitStrategy() + .withRegEx(".*database system is ready to accept connections.*\\s") + .withTimes(2) + .withStartupTimeout(Duration.of(60, SECONDS))); + + addExposedPort(PORT); + + withNetworkAliases(CONTAINER_NAME); + + withLogConsumer(new Slf4jLogConsumer(log)); + } + + @Override + protected void configure() { + addEnv("POSTGRES_USER", POSTGRES_MAPPING_USER); + addEnv("POSTGRES_PASSWORD", POSTGRES_MAPPING_PW); + addEnv("EHRBASE_USER_ADMIN", EHRbaseContainerOld.EHRBASE_ADMIN_USER); + addEnv("EHRBASE_PASSWORD_ADMIN", EHRbaseContainerOld.EHRBASE_ADMIN_USER); + addEnv("EHRBASE_USER", EHRbaseContainerOld.EHRBASE_USER); + addEnv("EHRBASE_PASSWORD", EHRbaseContainerOld.EHRBASE_PASSWORD); + } +} diff --git a/application/src/test/java/org/ehrbase/migration/application/KeycloakMockContainer.java b/application/src/test/java/org/ehrbase/migration/application/KeycloakMockContainer.java new file mode 100644 index 0000000..49ebbe6 --- /dev/null +++ b/application/src/test/java/org/ehrbase/migration/application/KeycloakMockContainer.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.nimbusds.jose.util.Base64; +import io.jsonwebtoken.Jwts; +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.interfaces.RSAPublicKey; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.mockserver.client.MockServerClient; +import org.mockserver.model.HttpResponse; +import org.mockserver.model.MediaType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.lifecycle.Startable; + +public class KeycloakMockContainer extends GenericContainer { + + public static final String CONTAINER_NAME = "keycloak"; + + public static final int PORT = 1080; + + public static final String KEY_ID = UUID.randomUUID().toString(); + + public static final KeyPair KEY_PAIR = Jwts.SIG.RS256.keyPair().build(); + + private static final String IMAGE = "mockserver/mockserver:5.15.0"; + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + public KeycloakMockContainer(Network network, List startables) { + super(IMAGE); + withAccessToHost(true); + withNetwork(network); + withExposedPorts(PORT); + withNetworkAliases(CONTAINER_NAME); + withLogConsumer(new Slf4jLogConsumer(log)); + dependsOn(startables); + + waitingFor(Wait.forLogMessage(".*started on port: %s.*".formatted(PORT), 1)); + } + + @Override + public void start() { + super.start(); + + MockServerClient mockServerClient = new MockServerClient(getHost(), getMappedPort(PORT)); + try { + mockServerClient + .when(request().withMethod("GET").withPath("/auth/realms/master/protocol/openid-connect/certs")) + .respond(certsResponse()); + mockServerClient + .when(request().withMethod("GET").withPath("/auth/realms/master/.well-known/openid-configuration")) + .respond(infoResponse()); + } catch (Exception e) { + log.error("Mock response could not be registered", e); + } + } + + private HttpResponse certsResponse() throws Exception { + return response() + .withStatusCode(200) + .withBody(new ObjectMapper().writeValueAsString(certResponseBody()), MediaType.APPLICATION_JSON); + } + + private HttpResponse infoResponse() throws Exception { + return response() + .withStatusCode(200) + .withBody(new ObjectMapper().writeValueAsString(infoResponseBody()), MediaType.APPLICATION_JSON); + } + + public Map certResponseBody() { + final RSAPublicKey publicKey = (RSAPublicKey) KEY_PAIR.getPublic(); + final BigInteger modulus = publicKey.getModulus(); + final BigInteger exp = publicKey.getPublicExponent(); + + final Map keyInfo = Map.of( + "kid", + KEY_ID, + "kty", + "RSA", + "alg", + "RS256", + "use", + "sig", + "n", + Base64.encode(modulus).toString(), + "e", + Base64.encode(exp).toString()); + + return Map.of("keys", List.of(keyInfo)); + } + + public Map infoResponseBody() { + + return Map.of( + "issuer", + "http://%s:%s/auth/realms/master" + .formatted(KeycloakMockContainer.CONTAINER_NAME, KeycloakMockContainer.PORT), + "jwks_uri", + "http://%s:%s/auth/realms/master/protocol/openid-connect/certs" + .formatted(KeycloakMockContainer.CONTAINER_NAME, KeycloakMockContainer.PORT)); + } +} diff --git a/application/src/test/java/org/ehrbase/migration/application/MigrationToolTestIT.java b/application/src/test/java/org/ehrbase/migration/application/MigrationToolTestIT.java new file mode 100644 index 0000000..6ebba60 --- /dev/null +++ b/application/src/test/java/org/ehrbase/migration/application/MigrationToolTestIT.java @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.application; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import com.nedap.archie.rm.generic.AuditDetails; +import com.nedap.archie.rm.generic.PartyIdentified; +import com.nedap.archie.rm.generic.RevisionHistoryItem; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectRef; +import com.nedap.archie.rm.support.identification.ObjectVersionId; +import com.nedap.archie.rm.support.identification.TerminologyId; +import com.nimbusds.jose.JOSEObjectType; +import io.jsonwebtoken.JwtBuilder; +import io.jsonwebtoken.Jwts; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.stream.IntStream; +import org.apache.http.HttpHeaders; +import org.apache.http.HttpRequestInterceptor; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.xmlbeans.XmlException; +import org.assertj.core.api.SoftAssertions; +import org.assertj.core.groups.Tuple; +import org.ehrbase.migration.service.ProcessService; +import org.ehrbase.openehr.sdk.client.openehrclient.OpenEhrClientConfig; +import org.ehrbase.openehr.sdk.client.openehrclient.builder.ContributionBuilder; +import org.ehrbase.openehr.sdk.client.openehrclient.defaultrestclient.DefaultRestClient; +import org.ehrbase.openehr.sdk.response.dto.ContributionCreateDto; +import org.ehrbase.openehr.sdk.serialisation.RMDataFormat; +import org.ehrbase.openehr.sdk.serialisation.flatencoding.FlatFormat; +import org.ehrbase.openehr.sdk.serialisation.flatencoding.FlatJasonProvider; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.ArchieObjectMapperProvider; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.CanonicalJson; +import org.ehrbase.openehr.sdk.webtemplate.templateprovider.TemplateProvider; +import org.jetbrains.annotations.NotNull; +import org.junit.jupiter.api.Test; +import org.openehr.schemas.v1.OPERATIONALTEMPLATE; +import org.openehr.schemas.v1.TemplateDocument; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.util.TestPropertyValues; +import org.springframework.context.ApplicationContextInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.test.context.ContextConfiguration; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.junit.jupiter.Testcontainers; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) +@Testcontainers +@ContextConfiguration(initializers = MigrationToolTestIT.Initializer.class) +class MigrationToolTestIT { + + protected static GenericContainer postgresOld; + + protected static GenericContainer postgresNew; + + protected static GenericContainer ehrbaseOld; + + protected static GenericContainer ehrbaseNew; + + protected static GenericContainer keycloakMock; + + public static class Initializer implements ApplicationContextInitializer { + + @Override + public void initialize(ConfigurableApplicationContext configurableApplicationContext) { + var values = TestPropertyValues.of( + "spring.datasource.export.url=jdbc:postgresql://%s:%d/ehrbase" + .formatted( + postgresOld.getHost(), postgresOld.getMappedPort(EHRbasePostgresOldContainer.PORT)), + "spring.datasource.import.url=jdbc:postgresql://%s:%d/ehrbase" + .formatted( + postgresNew.getHost(), postgresNew.getMappedPort(EHRbasePostgresNewContainer.PORT)), + "terminate=false", + "export.batch-size=10"); + + values.applyTo(configurableApplicationContext); + } + } + + private static final TemplateProvider TEMPLATE_PROVIDER = new TemplateProvider() { + @Override + public Optional find(String templateId) { + try { + return Optional.of(TemplateDocument.Factory.parse( + getClass().getResourceAsStream("/%s.opt".formatted(templateId.replace("-", "_")))) + .getTemplate()); + } catch (XmlException | IOException e) { + throw new RuntimeException(e); + } + } + }; + + @Autowired + private ProcessService processService; + + static { + try (Network network = Network.newNetwork()) { + + keycloakMock = new KeycloakMockContainer(network, Collections.emptyList()); + keycloakMock.start(); + + postgresOld = new EHRbasePostgresOldContainer(network); + postgresOld.start(); + + ehrbaseOld = new EHRbaseContainerOld(network, List.of(postgresOld)); + ehrbaseOld.start(); + + postgresNew = new EHRbasePostgresNewContainer(network); + postgresNew.start(); + + ehrbaseNew = new EHRbaseContainerNew(network, List.of(postgresNew)); + ehrbaseNew.start(); + } + } + + @Test + void test() throws IOException { + // TODO proper system id, separate test aspects + + String committer1Subject = "efb90305-f546-40aa-9c78-ba199a089cf6"; + DefaultRestClient restClient1 = setupRestClientWithInternalTemplateProvider(ehrbaseOld, committer1Subject); + + String committer2Subject = "03364ab8-0c38-47b1-9ee7-8fb90d60ce68"; + DefaultRestClient restClient2 = setupRestClientWithInternalTemplateProvider(ehrbaseOld, committer2Subject); + + // Load example Composition + restClient1.templateEndpoint().ensureExistence("conformance_ehrbase.de.v0"); + String exampleCompositionName = "conformance_ehrbase.de.v0_composition.json"; + + // Create EHR + EhrExampleData ehr1data = createExampleEhr( + exampleCompositionName, restClient1, committer1Subject, restClient2, committer2Subject); + + EhrExampleData ehr2data = createExampleEhr( + exampleCompositionName, restClient2, committer2Subject, restClient1, committer1Subject); + + IntStream.range(0, 25) + // .parallel() + .forEach(i -> createExampleEhr( + exampleCompositionName, restClient1, committer1Subject, restClient2, committer2Subject)); + + // Perform migration + processService.db2db(); + + DefaultRestClient restClientNew = setupRestClientWithDefaultTemplateProvider(ehrbaseNew, committer1Subject); + + Optional template = + restClientNew.templateEndpoint().findTemplate("conformance-ehrbase.de.v0"); + + assertThat(template).isNotEmpty(); + + assertEhrMigration(restClientNew, ehr1data); + assertEhrMigration(restClientNew, ehr2data); + } + + private static void assertEhrMigration(DefaultRestClient restClientNew, EhrExampleData ehr1data) + throws IOException { + Optional ehrStatus = restClientNew.ehrEndpoint().getEhrStatus(ehr1data.ehr()); + assertThat(ehrStatus) + .isNotEmpty() + .get() + .extracting(EhrStatus::isQueryable) + .isEqualTo(false); + + Optional raw = restClientNew + .compositionEndpoint(ehr1data.ehr()) + .findRaw(getVersionedObjectUid(ehr1data.composition1Id())); + + assertThat(raw).isNotEmpty(); + + assertRoundTrip(ehr1data.composition1(), raw.orElseThrow(), new String[] {}, new String[] {}); + + assertRevisionHistory( + restClientNew, + ehr1data.ehr(), + ehr1data.composition1Id(), + Tuple.tuple("1", "creation", ehr1data.committer1ExternalRef(), ehr1data.committer1Name()), + Tuple.tuple("2", "modification", ehr1data.committer1ExternalRef(), ehr1data.committer1Name()), + Tuple.tuple("3", "modification", ehr1data.committer1ExternalRef(), ehr1data.committer1Name())); + + assertRevisionHistory( + restClientNew, + ehr1data.ehr(), + ehr1data.composition2Id(), + Tuple.tuple("1", "creation", ehr1data.committer2ExternalRef(), ehr1data.committer2Name()), + Tuple.tuple("2", "deleted", ehr1data.committer2ExternalRef(), ehr1data.committer2Name())); + + Folder directory = restClientNew + .directoryCrudEndpoint(ehr1data.ehr()) + .getDirectory() + .orElse(null); + + assertThat(directory).isNotNull(); + assertThat(directory.getFolders()).hasSize(1); + assertThat(directory.getFolders().getFirst().getNameAsString()).isEqualTo("SubFolder"); + assertThat(directory.getFolders().getFirst().getItems()) + .extracting(o -> o.getId().getValue()) + .containsExactly(ehr1data.composition1Id().getRoot().getValue()); + + Optional contribution = + restClientNew.contributionEndpoint(ehr1data.ehr()).find(ehr1data.saveContribution()); + + assertThat(contribution) + .isNotEmpty() + .get() + .extracting(c -> ((PartyIdentified) c.getAudit().getCommitter()).getName()) + .isEqualTo("test"); + } + + @NotNull + private MigrationToolTestIT.EhrExampleData createExampleEhr( + String exampleCompositionName, + DefaultRestClient restClient1, + String committer1Subject, + DefaultRestClient restClient2, + String committer2Subject) { + UUID ehr = restClient1.ehrEndpoint().createEhr(); + + EhrStatus status = restClient1.ehrEndpoint().getEhrStatus(ehr).orElseThrow(); + + status.setQueryable(false); + + restClient1.ehrEndpoint().updateEhrStatus(ehr, status); + + // Store Composition Version 1 + Composition composition1 = loadComposition(exampleCompositionName); + ObjectVersionId composition1Id = restClient1.compositionEndpoint(ehr).mergeRaw(composition1); + + // update 1->2 + composition1.setUid(composition1Id); + composition1Id = restClient1.compositionEndpoint(ehr).mergeRaw(composition1); + + // update 2->3 + composition1.setUid(composition1Id); + composition1Id = restClient1.compositionEndpoint(ehr).mergeRaw(composition1); + + List revisionHistory1 = restClient1 + .versionedCompositionEndpoint(ehr) + .findRevisionHistory(getVersionedObjectUid(composition1Id)); + + // Check source db + + String committer1Name = "EHRbase Internal " + committer1Subject; + assertThat(revisionHistory1) + .extracting(r -> ((PartyIdentified) r.getAudits().getFirst().getCommitter()).getName()) + .containsExactly(committer1Name, committer1Name, committer1Name); + + String committer1ExternalRef = getAuditCommitterUuid(revisionHistory1.getFirst()); + + String committer2Name = "EHRbase Internal " + committer2Subject; + Composition composition2 = loadComposition(exampleCompositionName); + ObjectVersionId composition2Id = restClient2.compositionEndpoint(ehr).mergeRaw(composition2); + + List revisionHistory2 = restClient2 + .versionedCompositionEndpoint(ehr) + .findRevisionHistory(getVersionedObjectUid(composition2Id)); + + String committer2ExternalRef = getAuditCommitterUuid(revisionHistory2.getFirst()); + + restClient2.compositionEndpoint(ehr).delete(composition2Id); + + // Folder with composition 1 + + restClient2.directoryCrudEndpoint(ehr).createDirectory(new Folder()); + Folder folder = restClient2.directoryCrudEndpoint(ehr).getDirectory().orElseThrow(); + + Folder subFolder = new Folder(); + subFolder.setNameAsString("SubFolder"); + folder.addFolder(subFolder); + + subFolder.addItem( + new ObjectRef<>(new HierObjectId(composition1Id.getRoot().getValue()), "local", "Composition")); + restClient2.directoryCrudEndpoint(ehr).updateDirectory(folder); + + // save via contribution + Composition composition3 = loadComposition(exampleCompositionName); + ContributionCreateDto contributionCreateDto = ContributionBuilder.builder(new AuditDetails( + "local.ehrbase.org", + new PartyIdentified(null, "test", null), + null, + new DvCodedText("creation", new CodePhrase(new TerminologyId("openehr"), "249")), + null)) + .addCompositionCreation(composition3) + .build(); + UUID saveContribution; + try { + saveContribution = restClient2.contributionEndpoint(ehr).saveContribution(contributionCreateDto); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + return new EhrExampleData( + ehr, + composition1, + composition1Id, + committer1Name, + committer1ExternalRef, + committer2Name, + composition2Id, + committer2ExternalRef, + saveContribution); + } + + private record EhrExampleData( + UUID ehr, + Composition composition1, + ObjectVersionId composition1Id, + String committer1Name, + String committer1ExternalRef, + String committer2Name, + ObjectVersionId composition2Id, + String committer2ExternalRef, + UUID saveContribution) {} + + private static void assertRevisionHistory( + DefaultRestClient restClientNew, UUID ehr, ObjectVersionId composition1Id, Tuple... expectedAudits) { + List revisionHistory1New = restClientNew + .versionedCompositionEndpoint(ehr) + .findRevisionHistory(getVersionedObjectUid(composition1Id)); + assertThat(revisionHistory1New) + .extracting( + r -> r.getVersionId().getVersionTreeId().getValue(), + r -> r.getAudits().getFirst().getChangeType().getValue(), + MigrationToolTestIT::getAuditCommitterUuid, + r -> ((PartyIdentified) r.getAudits().getFirst().getCommitter()).getName()) + .containsExactly(expectedAudits); + } + + @NotNull + private Composition loadComposition(String exampleCompositionName) { + Composition composition; + try { + composition = CanonicalJson.MARSHAL_OM.readValue( + getClass().getResourceAsStream("/" + exampleCompositionName), Composition.class); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + composition.setUid(null); + return composition; + } + + private static UUID getVersionedObjectUid(ObjectVersionId objectVersionId) { + return UUID.fromString(objectVersionId.getObjectId().getValue()); + } + + private static String getAuditCommitterUuid(RevisionHistoryItem r) { + return r.getAudits().getFirst().getCommitter().getExternalRef().getId().getValue(); + } + + private static void assertRoundTrip( + Composition original, Composition imported, String[] expectedMissing, String[] expectedExtra) + throws IOException { + + // uid is missing + original.setUid(imported.getUid()); + + String templateId = original.getArchetypeDetails().getTemplateId().getValue(); + + RMDataFormat cut = new FlatJasonProvider(TEMPLATE_PROVIDER).buildFlatJson(FlatFormat.SIM_SDT, templateId); + + SoftAssertions softAssertions = new SoftAssertions(); + + String actual = cut.marshal(imported); + + String expected = cut.marshal(original); + + List errors = compareJsonFlat(actual, expected); + + softAssertions + .assertThat(errors) + .filteredOn(s -> s.startsWith("Missing")) + .containsExactlyInAnyOrder(expectedMissing); + + softAssertions + .assertThat(errors) + .filteredOn(s -> s.startsWith("Extra")) + .containsExactlyInAnyOrder(expectedExtra); + + softAssertions.assertAll(); + } + + private static List compareJsonFlat(String actualJson, String expectedJson) throws JsonProcessingException { + List errors = new ArrayList<>(); + ObjectMapper objectMapper = ArchieObjectMapperProvider.getObjectMapper(); + + Map actual = objectMapper.readValue(actualJson, Map.class); + Map expected = objectMapper.readValue(expectedJson, Map.class); + + actual.forEach((key, value) -> { + if (!expected.containsKey(key) || !expected.get(key).equals(value)) { + errors.add(String.format("Missing path: %s, value: %s", key, value)); + } + }); + + expected.forEach((key, value) -> { + if (!actual.containsKey(key) || !actual.get(key).equals(value)) { + errors.add(String.format("Extra path: %s, value: %s", key, value)); + } + }); + + return errors; + } + + public static String fixtureToken(String committerSub) { + final Date now = new Date(); + JwtBuilder jwtBuilder = Jwts.builder() + .issuedAt(now) + .expiration(new Date(now.getTime() + Duration.ofSeconds(300).toMillis())) + .claim("sub", committerSub) + .claim( + "iss", + "http://%s:%d/auth/realms/master" + .formatted(KeycloakMockContainer.CONTAINER_NAME, KeycloakMockContainer.PORT)) + .signWith(KeycloakMockContainer.KEY_PAIR.getPrivate()) + .header() + .add("kid", KeycloakMockContainer.KEY_ID) + .add("typ", JOSEObjectType.JWT.getType()) + .and(); + + jwtBuilder = jwtBuilder.claim("realm_access", Map.of("roles", List.of("hcp"))); + + return jwtBuilder.compact(); + } + + private static DefaultRestClient setupRestClientWithDefaultTemplateProvider( + GenericContainer container, String committerSub) { + + CloseableHttpClient client = HttpClientBuilder.create() + .addInterceptorFirst((HttpRequestInterceptor) (request, context) -> { + request.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + fixtureToken(committerSub)); + }) + .build(); + + return new DefaultRestClient(new OpenEhrClientConfig(ehrBaseAPIEndpoint(container)), null, client); + } + + private static DefaultRestClient setupRestClientWithInternalTemplateProvider( + GenericContainer container, String committerSub) { + + CloseableHttpClient client = HttpClientBuilder.create() + .addInterceptorFirst((HttpRequestInterceptor) (request, context) -> { + request.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + fixtureToken(committerSub)); + }) + .build(); + + return new DefaultRestClient(new OpenEhrClientConfig(ehrBaseAPIEndpoint(container)), TEMPLATE_PROVIDER, client); + } + + protected static URI ehrBaseAPIEndpoint(GenericContainer container) { + return URI.create("http://%s:%d/ehrbase/" + .formatted(container.getHost(), container.getMappedPort(EHRbaseContainerOld.PORT))); + } +} diff --git a/application/src/test/resources/conformance_ehrbase.de.v0.opt b/application/src/test/resources/conformance_ehrbase.de.v0.opt new file mode 100644 index 0000000..b92407a --- /dev/null +++ b/application/src/test/resources/conformance_ehrbase.de.v0.opt @@ -0,0 +1,3168 @@ + + diff --git a/application/src/test/resources/conformance_ehrbase.de.v0_composition.json b/application/src/test/resources/conformance_ehrbase.de.v0_composition.json new file mode 100644 index 0000000..82765c1 --- /dev/null +++ b/application/src/test/resources/conformance_ehrbase.de.v0_composition.json @@ -0,0 +1,2589 @@ +{ + "_type": "COMPOSITION", + "name": { + "_type": "DV_TEXT", + "value": "conformance-ehrbase.de.v0" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-COMPOSITION.conformance_composition_.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "territory": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_3166-1" + }, + "code_string": "US" + }, + "category": { + "_type": "DV_CODED_TEXT", + "value": "event", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "433" + } + }, + "composer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "EHR.NETWORK", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "1234-5678", + "scheme": "UUID" + } + }, + "name": "Silvia Blake" + }, + "context": { + "_type": "EVENT_CONTEXT", + "start_time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T14:19:31.649613+01:00" + }, + "end_time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T15:19:31.649613+01:00" + }, + "location": "microbiology lab 2", + "setting": { + "_type": "DV_CODED_TEXT", + "value": "other care", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "238" + } + }, + "health_care_facility": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "9091", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Hospital" + }, + "participations": [ + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "requester" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "face-to-face communication", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "216" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "199", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Dr. Marcus Johnson" + } + } + ] + }, + "content": [ + { + "_type": "SECTION", + "name": { + "_type": "DV_TEXT", + "value": "conformance section" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-SECTION.conformance_section.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "ACTION", + "name": { + "_type": "DV_TEXT", + "value": "conformance action" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-ACTION.conformance_action_.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "feeder_audit": { + "_type": "FEEDER_AUDIT", + "originating_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "feeder_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "original_content": { + "_type": "DV_PARSABLE", + "value": "Hello world!", + "formalism": "text/plain" + }, + "originating_system_audit": { + "_type": "FEEDER_AUDIT_DETAILS", + "system_id": "orig", + "location": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "12342341", + "scheme": "NMC" + } + }, + "name": "Org 1" + }, + "provider": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "subject": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T16:02:58.0094262+01:00" + }, + "version_id": "final" + } + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "workflow_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "WORKFLOW", + "id": { + "_type": "GENERIC_ID", + "value": "335645", + "scheme": "HOSPITAL-NS" + } + }, + "subject": { + "_type": "PARTY_SELF" + }, + "other_participations": [ + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "requester" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "face-to-face communication", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "216" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "199", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Dr. Marcus Johnson" + } + }, + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "performer" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "not specified", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "193" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "198", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Lara Markham" + } + } + ], + "protocol": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "dv_text in protocol" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "guideline_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "GUIDELINE", + "id": { + "_type": "GENERIC_ID", + "value": "3445", + "scheme": "HOSPITAL-NS" + } + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-01-31T10:33:28.72414+01:00" + }, + "description": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "dv_text in description" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "ism_transition": { + "_type": "ISM_TRANSITION", + "current_state": { + "_type": "DV_CODED_TEXT", + "value": "completed", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "532" + } + }, + "transition": { + "_type": "DV_CODED_TEXT", + "value": "finish", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "548" + } + }, + "careflow_step": { + "_type": "DV_CODED_TEXT", + "value": "transition", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0006" + } + }, + "reason": [ + { + "_type": "DV_TEXT", + "value": "reason 1" + } + ] + }, + "instruction_details": { + "_type": "INSTRUCTION_DETAILS", + "instruction_id": { + "_type": "LOCATABLE_REF", + "namespace": "local", + "type": "INSTRUCTION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "4cdc3017-d8c5-4cd3-9900-f3bb7171d006" + }, + "path": "/content[openEHR-EHR-SECTION.conformance_section.v0]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0]" + }, + "activity_id": "activities[at0001]" + }, + "archetype_node_id": "openEHR-EHR-ACTION.conformance_action_.v0" + }, + { + "_type": "ADMIN_ENTRY", + "name": { + "_type": "DV_TEXT", + "value": "conformance admin entry" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-ADMIN_ENTRY.conformance_admin_entry.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "feeder_audit": { + "_type": "FEEDER_AUDIT", + "originating_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "feeder_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "original_content": { + "_type": "DV_PARSABLE", + "value": "Hello world!", + "formalism": "text/plain" + }, + "originating_system_audit": { + "_type": "FEEDER_AUDIT_DETAILS", + "system_id": "orig", + "location": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "12342341", + "scheme": "NMC" + } + }, + "name": "Org 1" + }, + "provider": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "subject": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T16:02:58.0094262+01:00" + }, + "version_id": "final" + } + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "workflow_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "WORKFLOW", + "id": { + "_type": "GENERIC_ID", + "value": "335645", + "scheme": "HOSPITAL-NS" + } + }, + "subject": { + "_type": "PARTY_SELF" + }, + "other_participations": [ + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "requester" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "face-to-face communication", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "216" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "199", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Dr. Marcus Johnson" + } + }, + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "performer" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "not specified", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "193" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "198", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Lara Markham" + } + } + ], + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "DV_TEXT 56" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-ADMIN_ENTRY.conformance_admin_entry.v0" + }, + { + "_type": "EVALUATION", + "name": { + "_type": "DV_TEXT", + "value": "conformance evaluation" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-EVALUATION.conformance_evaluation.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "feeder_audit": { + "_type": "FEEDER_AUDIT", + "originating_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "feeder_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "original_content": { + "_type": "DV_PARSABLE", + "value": "Hello world!", + "formalism": "text/plain" + }, + "originating_system_audit": { + "_type": "FEEDER_AUDIT_DETAILS", + "system_id": "orig", + "location": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "12342341", + "scheme": "NMC" + } + }, + "name": "Org 1" + }, + "provider": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "subject": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T16:02:58.0094262+01:00" + }, + "version_id": "final" + } + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "workflow_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "WORKFLOW", + "id": { + "_type": "GENERIC_ID", + "value": "335645", + "scheme": "HOSPITAL-NS" + } + }, + "subject": { + "_type": "PARTY_SELF" + }, + "other_participations": [ + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "requester" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "face-to-face communication", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "216" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "199", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Dr. Marcus Johnson" + } + }, + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "performer" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "not specified", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "193" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "198", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Lara Markham" + } + } + ], + "protocol": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "dv_text in protocol" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "guideline_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "GUIDELINE", + "id": { + "_type": "GENERIC_ID", + "value": "3445", + "scheme": "HOSPITAL-NS" + } + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "dv_text in data" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-EVALUATION.conformance_evaluation.v0" + }, + { + "_type": "INSTRUCTION", + "name": { + "_type": "DV_TEXT", + "value": "conformance instruction" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-INSTRUCTION.conformance_instruction.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "feeder_audit": { + "_type": "FEEDER_AUDIT", + "originating_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "feeder_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "original_content": { + "_type": "DV_PARSABLE", + "value": "Hello world!", + "formalism": "text/plain" + }, + "originating_system_audit": { + "_type": "FEEDER_AUDIT_DETAILS", + "system_id": "orig", + "location": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "12342341", + "scheme": "NMC" + } + }, + "name": "Org 1" + }, + "provider": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "subject": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T16:02:58.0094262+01:00" + }, + "version_id": "final" + } + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "workflow_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "WORKFLOW", + "id": { + "_type": "GENERIC_ID", + "value": "335645", + "scheme": "HOSPITAL-NS" + } + }, + "subject": { + "_type": "PARTY_SELF" + }, + "other_participations": [ + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "requester" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "face-to-face communication", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "216" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "199", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Dr. Marcus Johnson" + } + }, + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "performer" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "not specified", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "193" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "198", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Lara Markham" + } + } + ], + "protocol": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "DV_TEXT 91" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "guideline_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "GUIDELINE", + "id": { + "_type": "GENERIC_ID", + "value": "3445", + "scheme": "HOSPITAL-NS" + } + }, + "narrative": { + "_type": "DV_TEXT", + "value": "Human readable instruction narrative" + }, + "expiry_time": { + "_type": "DV_DATE_TIME", + "value": "2022-01-31T10:33:28.724259+01:00" + }, + "wf_definition": { + "_type": "DV_PARSABLE", + "value": "wf_definition", + "formalism": "formalism" + }, + "activities": [ + { + "_type": "ACTIVITY", + "name": { + "_type": "DV_TEXT", + "value": "Current Activity" + }, + "description": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "DV_TEXT 45" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "at0002" + }, + "timing": { + "_type": "DV_PARSABLE", + "value": "R4/2022-01-31T10:00:00+01:00/P3M", + "formalism": "timing" + }, + "action_archetype_id": "/openEHR-EHR-CLUSTER.conformance_action.v0/", + "archetype_node_id": "at0001" + } + ], + "archetype_node_id": "openEHR-EHR-INSTRUCTION.conformance_instruction.v0" + }, + { + "_type": "OBSERVATION", + "name": { + "_type": "DV_TEXT", + "value": "Conformance Observation" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-OBSERVATION.conformance_observation.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "workflow_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "WORKFLOW", + "id": { + "_type": "GENERIC_ID", + "value": "335645", + "scheme": "HOSPITAL-NS" + } + }, + "subject": { + "_type": "PARTY_SELF" + }, + "other_participations": [ + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "requester" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "face-to-face communication", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "216" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "199", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Dr. Marcus Johnson" + } + }, + { + "_type": "PARTICIPATION", + "function": { + "_type": "DV_TEXT", + "value": "performer" + }, + "mode": { + "_type": "DV_CODED_TEXT", + "value": "not specified", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "193" + } + }, + "performer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "HOSPITAL-NS", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "198", + "scheme": "HOSPITAL-NS" + } + }, + "name": "Lara Markham" + } + } + ], + "protocol": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0021" + } + ], + "archetype_node_id": "at0020" + }, + "guideline_id": { + "_type": "OBJECT_REF", + "namespace": "HOSPITAL-NS", + "type": "GUIDELINE", + "id": { + "_type": "GENERIC_ID", + "value": "3445", + "scheme": "HOSPITAL-NS" + } + }, + "data": { + "name": { + "_type": "DV_TEXT", + "value": "History" + }, + "origin": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "events": [ + { + "_type": "INTERVAL_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "state": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT_State" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0031" + } + ], + "archetype_node_id": "at0029" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum", + "mappings": [ + { + "_type": "TERM_MAPPING", + "match": "=", + "target": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "SNOMED-CT" + }, + "code_string": "21794005" + } + }, + { + "_type": "TERM_MAPPING", + "match": ">", + "target": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "SNOMED-CT" + }, + "code_string": "21794000" + } + } + ] + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_CODED_TEXT" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "term1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0006" + } + }, + "archetype_node_id": "at0005" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_QUANTITY" + }, + "null_flavour": { + "_type": "DV_CODED_TEXT", + "value": "unknown", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "253" + } + }, + "null_reason": { + "_type": "DV_TEXT", + "value": "sample reason" + }, + "archetype_node_id": "at0008" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_PROPORTION" + }, + "value": { + "_type": "DV_PROPORTION", + "numerator": 42.0, + "denominator": 3.0, + "type": 3 + }, + "archetype_node_id": "at0009" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_COUNT" + }, + "value": { + "_type": "DV_COUNT", + "magnitude": 42 + }, + "archetype_node_id": "at0010" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DATE_TIME" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "archetype_node_id": "at0011" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TIME" + }, + "value": { + "_type": "DV_TIME", + "value": "04:05:06" + }, + "archetype_node_id": "at0012" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DATE" + }, + "value": { + "_type": "DV_DATE", + "value": "2022-02-03" + }, + "archetype_node_id": "at0013" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_ORDINAL" + }, + "value": { + "_type": "DV_ORDINAL", + "symbol": { + "_type": "DV_CODED_TEXT", + "value": "value1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0015" + } + }, + "value": 1 + }, + "archetype_node_id": "at0014" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_BOOLEAN" + }, + "value": { + "_type": "DV_BOOLEAN", + "value": true + }, + "archetype_node_id": "at0017" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DURATION" + }, + "value": { + "_type": "DV_DURATION", + "value": "PT0S" + }, + "archetype_node_id": "at0018" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_IDENTIFIER" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "dev/null" + }, + "archetype_node_id": "at0019" + }, + { + "_type": "CLUSTER", + "name": { + "_type": "DV_TEXT", + "value": "conformance cluster" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "ANY" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_ehr_uri" + }, + "value": { + "_type": "DV_EHR_URI", + "value": "ehr:/." + }, + "archetype_node_id": "at0025" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_multimedia" + }, + "value": { + "_type": "DV_MULTIMEDIA", + "uri": { + "_type": "DV_URI", + "value": "https://www.example.com/sample" + }, + "media_type": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_media-types" + }, + "code_string": "video/H261" + }, + "size": 504903212 + }, + "archetype_node_id": "at0026" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_parsable" + }, + "value": { + "_type": "DV_PARSABLE", + "value": "Hello WorldHello World!", + "formalism": "text/html" + }, + "archetype_node_id": "at0027" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_uri" + }, + "value": { + "_type": "DV_URI", + "value": "https://www.example.com/sample" + }, + "archetype_node_id": "at0028" + } + ], + "archetype_node_id": "at0003" + }, + "width": { + "_type": "DV_DURATION", + "value": "P30D" + }, + "sample_count": 5, + "math_function": { + "_type": "DV_CODED_TEXT", + "value": "mean", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "146" + } + }, + "archetype_node_id": "at0002" + }, + { + "_type": "POINT_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "state": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT_State" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0031" + } + ], + "archetype_node_id": "at0029" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_CODED_TEXT" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "term1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0006" + } + }, + "archetype_node_id": "at0005" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_QUANTITY" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "mm", + "magnitude": 22.0 + }, + "archetype_node_id": "at0008" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_PROPORTION" + }, + "value": { + "_type": "DV_PROPORTION", + "numerator": 42.0, + "denominator": 3.0, + "type": 3 + }, + "archetype_node_id": "at0009" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_COUNT" + }, + "value": { + "_type": "DV_COUNT", + "magnitude": 42 + }, + "archetype_node_id": "at0010" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DATE_TIME" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "archetype_node_id": "at0011" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TIME" + }, + "value": { + "_type": "DV_TIME", + "value": "04:05:06" + }, + "archetype_node_id": "at0012" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DATE" + }, + "value": { + "_type": "DV_DATE", + "value": "2022-02-03" + }, + "archetype_node_id": "at0013" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_ORDINAL" + }, + "value": { + "_type": "DV_ORDINAL", + "symbol": { + "_type": "DV_CODED_TEXT", + "value": "value1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0015" + } + }, + "value": 1 + }, + "archetype_node_id": "at0014" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_BOOLEAN" + }, + "value": { + "_type": "DV_BOOLEAN", + "value": true + }, + "archetype_node_id": "at0017" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DURATION" + }, + "value": { + "_type": "DV_DURATION", + "value": "PT0S" + }, + "archetype_node_id": "at0018" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_IDENTIFIER" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "dev/null" + }, + "archetype_node_id": "at0019" + }, + { + "_type": "CLUSTER", + "name": { + "_type": "DV_TEXT", + "value": "conformance cluster" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "ANY" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_ehr_uri" + }, + "value": { + "_type": "DV_EHR_URI", + "value": "ehr:/." + }, + "archetype_node_id": "at0025" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_multimedia" + }, + "value": { + "_type": "DV_MULTIMEDIA", + "uri": { + "_type": "DV_URI", + "value": "https://www.example.com/sample" + }, + "media_type": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_media-types" + }, + "code_string": "video/H261" + }, + "size": 504903212 + }, + "archetype_node_id": "at0026" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_parsable" + }, + "value": { + "_type": "DV_PARSABLE", + "value": "Hello WorldHello World!", + "formalism": "text/html" + }, + "archetype_node_id": "at0027" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_uri" + }, + "value": { + "_type": "DV_URI", + "value": "https://www.example.com/sample" + }, + "archetype_node_id": "at0028" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "at0002" + }, + { + "_type": "INTERVAL_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "state": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Item tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT_State" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0031" + } + ], + "archetype_node_id": "at0029" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_CODED_TEXT" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "term1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0006" + } + }, + "archetype_node_id": "at0005" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_QUANTITY" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "mm", + "magnitude": 22.0 + }, + "archetype_node_id": "at0008" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_PROPORTION" + }, + "value": { + "_type": "DV_PROPORTION", + "numerator": 42.0, + "denominator": 3.0, + "type": 3 + }, + "archetype_node_id": "at0009" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_COUNT" + }, + "value": { + "_type": "DV_COUNT", + "magnitude": 42 + }, + "archetype_node_id": "at0010" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DATE_TIME" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "archetype_node_id": "at0011" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TIME" + }, + "value": { + "_type": "DV_TIME", + "value": "04:05:06" + }, + "archetype_node_id": "at0012" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DATE" + }, + "value": { + "_type": "DV_DATE", + "value": "2022-02-03" + }, + "archetype_node_id": "at0013" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_ORDINAL" + }, + "value": { + "_type": "DV_ORDINAL", + "symbol": { + "_type": "DV_CODED_TEXT", + "value": "value1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0015" + } + }, + "value": 1 + }, + "archetype_node_id": "at0014" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_BOOLEAN" + }, + "value": { + "_type": "DV_BOOLEAN", + "value": true + }, + "archetype_node_id": "at0017" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_DURATION" + }, + "value": { + "_type": "DV_DURATION", + "value": "PT0S" + }, + "archetype_node_id": "at0018" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_IDENTIFIER" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "dev/null" + }, + "archetype_node_id": "at0019" + }, + { + "_type": "CLUSTER", + "name": { + "_type": "DV_TEXT", + "value": "conformance cluster" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + "template_id": { + "value": "conformance-ehrbase.de.v0" + }, + "rm_version": "1.0.4" + }, + "feeder_audit": { + "_type": "FEEDER_AUDIT", + "originating_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "feeder_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "original_content": { + "_type": "DV_PARSABLE", + "value": "Hello world!", + "formalism": "text/plain" + }, + "originating_system_audit": { + "_type": "FEEDER_AUDIT_DETAILS", + "system_id": "orig", + "location": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "12342341", + "scheme": "NMC" + } + }, + "name": "Org 1" + }, + "provider": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "subject": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T16:02:58.0094262+01:00" + }, + "version_id": "final" + } + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "ANY" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + + + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_ehr_uri" + }, + "value": { + "_type": "DV_EHR_URI", + "value": "ehr:/." + }, + "archetype_node_id": "at0025" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_multimedia" + }, + "value": { + "_type": "DV_MULTIMEDIA", + "uri": { + "_type": "DV_URI", + "value": "https://www.example.com/sample" + }, + "media_type": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_media-types" + }, + "code_string": "video/H261" + }, + "size": 504903212 + }, + "archetype_node_id": "at0026" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_parsable" + }, + "value": { + "_type": "DV_PARSABLE", + "value": "Hello WorldHello World!", + "formalism": "text/html" + }, + "archetype_node_id": "at0027" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "dv_uri" + }, + "value": { + "_type": "DV_URI", + "value": "https://www.example.com/sample" + }, + "archetype_node_id": "at0028" + } + ], + "archetype_node_id": "at0003" + }, + "width": { + "_type": "DV_DURATION", + "value": "PT42H" + }, + "math_function": { + "_type": "DV_CODED_TEXT", + "value": "minimum", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "145" + } + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-OBSERVATION.conformance_observation.v0" + } + ], + "archetype_node_id": "openEHR-EHR-SECTION.conformance_section.v0" + + + } + ], + "archetype_node_id": "openEHR-EHR-COMPOSITION.conformance_composition_.v0", + "feeder_audit": { + "_type": "FEEDER_AUDIT", + "originating_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "feeder_system_item_ids": [ + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer1", + "assigner": "assigner1", + "id": "id1", + "type": "PERSON" + }, + { + "_type": "DV_IDENTIFIER", + "issuer": "issuer2", + "assigner": "assigner2", + "id": "id2", + "type": "PERSON" + } + ], + "original_content": { + "_type": "DV_PARSABLE", + "value": "Hello world!", + "formalism": "text/plain" + }, + "originating_system_audit": { + "_type": "FEEDER_AUDIT_DETAILS", + "system_id": "orig", + "location": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "12342341", + "scheme": "NMC" + } + }, + "name": "Org 1" + }, + "provider": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "subject": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "uk.org.nmc", + "type": "PARTY", + "id": { + "_type": "GENERIC_ID", + "value": "456", + "scheme": "NMC" + } + }, + "name": "Per 1" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2021-12-21T16:02:58.0094262+01:00" + }, + "version_id": "final" + } + }, + "links": [ + { + "meaning": { + "_type": "DV_TEXT", + "value": "problem related note" + }, + "type": { + "_type": "DV_TEXT", + "value": "problem" + }, + "target": { + "_type": "DV_EHR_URI", + "value": "ehr://ehr.network/347a5490-55ee-4da9-b91a-9bba710f730e" + } + } + ] +} \ No newline at end of file diff --git a/bom/pom.xml b/bom/pom.xml new file mode 100644 index 0000000..a7e8a12 --- /dev/null +++ b/bom/pom.xml @@ -0,0 +1,159 @@ + + 4.0.0 + + org.ehrbase.migration + migration-bom + 1.1.0-SNAPSHOT + pom + EHRbase Migration Tool BOM + + + 21 + 21 + 21 + 21 + 2.0.0 + 2.9.1 + + + + + + org.springframework.boot + spring-boot-dependencies + 3.2.5 + pom + import + + + org.flywaydb + flyway-core + 8.5.13 + + + org.springframework.boot + spring-boot-configuration-processor + compile + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.slf4j + slf4j-api + + + org.postgresql + postgresql + 42.7.3 + + + org.jooq + jooq + 3.18.6 + + + org.ehrbase.openehr.sdk + validation + ${ehrbase.sdk.version} + + + org.ehrbase.openehr.sdk + client + ${ehrbase.sdk.version} + + + org.ehrbase.openehr + service + ${ehrbase.version} + + + org.ehrbase.openehr + jooq-pg + + + + + com.nedap.healthcare.archie + openehr-rm + 3.3.0 + + + net.lingala.zip4j + zip4j + 2.11.5 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.testcontainers + junit-jupiter + 1.19.7 + test + + + org.wiremock + wiremock + 3.5.4 + test + + + io.jsonwebtoken + jjwt-impl + 0.12.5 + test + + + io.jsonwebtoken + jjwt-jackson + 0.12.5 + test + + + org.mock-server + mockserver-junit-jupiter + 5.15.0 + test + + + com.nimbusds + nimbus-jose-jwt + 9.37.3 + test + + + + + + + + + com.diffplug.spotless + spotless-maven-plugin + 2.43.0 + + + + @format:off + @format:on + + + 2.39.0 + + + ../spotless-lic-header + + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..865497c --- /dev/null +++ b/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + + + org.ehrbase.migration + migration-bom + 1.1.0-SNAPSHOT + bom/pom.xml + + + org.ehrbase.migration + migration-tool + 1.1.0-SNAPSHOT + pom + EHRbase Migration Tool + + + bom + service + application + + + + + com.diffplug.spotless + spotless-maven-plugin + + + + ./spotless-lic-header + + + + + + + diff --git a/service/pom.xml b/service/pom.xml new file mode 100644 index 0000000..eaa261b --- /dev/null +++ b/service/pom.xml @@ -0,0 +1,193 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + + org.ehrbase.migration + migration-service + 1.1.0-SNAPSHOT + jar + EHRbase Migration Tool Service + + + 21 + + + + + + org.ehrbase.migration + migration-bom + ${project.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter + + + org.flywaydb + flyway-core + + + org.springframework.boot + spring-boot-configuration-processor + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.slf4j + slf4j-api + + + org.postgresql + postgresql + + + org.jooq + jooq + + + org.ehrbase.openehr.sdk + validation + + + commons-logging + commons-logging + + + + + org.ehrbase.openehr.sdk + client + + + org.ehrbase.openehr + service + + + com.nedap.healthcare.archie + openehr-rm + + + net.lingala.zip4j + zip4j + + + + org.springframework.boot + spring-boot-starter-test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + -parameters + + + + + com.diffplug.spotless + spotless-maven-plugin + 2.43.0 + + + + @format:off + @format:on + + + 2.40.0 + + + ../spotless-lic-header + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + agent for unit tests + + prepare-agent + + + surefireArgLine + + + + + agent for integration tests + + prepare-agent-integration + + + failsafeArgLine + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{surefireArgLine} + + + + test + + test + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + integration-test + verify + + integration-test + verify + + + + @{failsafeArgLine} + + **/*IT.java + + + + + + + + + diff --git a/service/src/main/java/org/ehrbase/migration/MigrationUtils.java b/service/src/main/java/org/ehrbase/migration/MigrationUtils.java new file mode 100644 index 0000000..a9fe1e6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/MigrationUtils.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration; + +import com.nedap.archie.rm.generic.PartyProxy; +import com.nedap.archie.rm.support.identification.ObjectId; +import com.nedap.archie.rm.support.identification.ObjectRef; +import java.util.Optional; +import java.util.UUID; + +public final class MigrationUtils { + private MigrationUtils() {} + + public static UUID getPartyProxyUuid(PartyProxy pp) { + return Optional.ofNullable(pp) + .map(PartyProxy::getExternalRef) + .map(ObjectRef::getId) + .map(ObjectId::getValue) + .map(name -> { + try { + return UUID.fromString(name); + } catch (IllegalArgumentException e) { + // ObjectId may be no UUID + return null; + } + }) + .orElse(null); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/config/ExportDatasourceConfiguration.java b/service/src/main/java/org/ehrbase/migration/config/ExportDatasourceConfiguration.java new file mode 100644 index 0000000..f02afec --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/config/ExportDatasourceConfiguration.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.config; + +import com.zaxxer.hikari.HikariDataSource; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import javax.sql.DataSource; +import org.ehrbase.migration.dto.EhrSchema; +import org.jooq.ConnectionProvider; +import org.jooq.DSLContext; +import org.jooq.SQLDialect; +import org.jooq.exception.DataAccessException; +import org.jooq.impl.DataSourceConnectionProvider; +import org.jooq.impl.DefaultConfiguration; +import org.jooq.impl.DefaultDSLContext; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConditionalOnProperty("spring.datasource.export.enable") +public class ExportDatasourceConfiguration { + + @Bean + @ConfigurationProperties("spring.datasource.export") + public DataSourceProperties exportDataSourceProperties() { + return new DataSourceProperties(); + } + + @Bean + public DataSource exportDataSource() { + HikariDataSource ds = (HikariDataSource) + exportDataSourceProperties().initializeDataSourceBuilder().build(); + ds.setPoolName("HikariExportPool"); + ds.setReadOnly(true); + return ds; + } + + /** + * Takes care of setting the tenant for old ehrbase + */ + public class TenantHandlingExportConnectionProvider implements ConnectionProvider { + + private Set handledConnections = ConcurrentHashMap.newKeySet(); + + private final ConnectionProvider delegate; + private volatile String tenantId; + + public TenantHandlingExportConnectionProvider(ConnectionProvider delegate) { + this.delegate = delegate; + } + + public void setTenant(EhrSchema ehrSchema) { + this.tenantId = Integer.toString(ehrSchema.id()); + handledConnections.clear(); + } + + @Override + public Connection acquire() throws DataAccessException { + Connection connection = delegate.acquire(); + if (tenantId != null && !handledConnections.contains(connection)) { + try (Statement statement = connection.createStatement()) { + statement.execute("select set_config('ehrbase.current_tenant', '%s', false)".formatted(tenantId)); + } catch (SQLException e) { + throw new DataAccessException(e.getMessage(), e); + } + handledConnections.add(connection); + } + return connection; + } + + @Override + public void release(Connection connection) throws DataAccessException { + delegate.release(connection); + } + } + + @Bean + public TenantHandlingExportConnectionProvider exportConnectionProvider( + @Qualifier("exportDataSource") DataSource dataSource) { + return new TenantHandlingExportConnectionProvider(new DataSourceConnectionProvider(dataSource)); + } + + @Bean + public DSLContext exportDslContext(@Qualifier("exportConnectionProvider") ConnectionProvider connectionProvider) { + DefaultConfiguration defaultConfiguration = new DefaultConfiguration(); + defaultConfiguration.set(connectionProvider); + defaultConfiguration.set(SQLDialect.POSTGRES); + return new DefaultDSLContext(defaultConfiguration); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/config/ImportDatasourceConfiguration.java b/service/src/main/java/org/ehrbase/migration/config/ImportDatasourceConfiguration.java new file mode 100644 index 0000000..53a89bf --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/config/ImportDatasourceConfiguration.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.config; + +import com.zaxxer.hikari.HikariDataSource; +import javax.sql.DataSource; +import org.jooq.ConnectionProvider; +import org.jooq.impl.DataSourceConnectionProvider; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ImportDatasourceConfiguration { + + @Bean + @ConfigurationProperties("spring.datasource.import") + public DataSourceProperties importDataSourceProperties() { + return new DataSourceProperties(); + } + + @Bean + public DataSource importDataSource( + @Qualifier("importDataSourceProperties") DataSourceProperties importDataSourceProperties) { + HikariDataSource ds = (HikariDataSource) + importDataSourceProperties.initializeDataSourceBuilder().build(); + ds.setPoolName("HikariImportPool"); + return ds; + } + + @Bean + public ConnectionProvider importConnectionProvider(@Qualifier("importDataSource") DataSource importDataSource) { + HikariDataSource ds = (HikariDataSource) importDataSource; + return new DataSourceConnectionProvider(ds); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/dto/EhrSchema.java b/service/src/main/java/org/ehrbase/migration/dto/EhrSchema.java new file mode 100644 index 0000000..5bb8095 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/EhrSchema.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +public record EhrSchema(Integer id, String tenantProperties, String tenantName, String tenantId) {} diff --git a/service/src/main/java/org/ehrbase/migration/dto/EhrSchemaData.java b/service/src/main/java/org/ehrbase/migration/dto/EhrSchemaData.java new file mode 100644 index 0000000..753163d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/EhrSchemaData.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +import static org.ehrbase.migration.importer.v4.jooq.pg.tables.Users.USERS; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.nedap.archie.rm.generic.PartyProxy; +import java.sql.Timestamp; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.MigrationUtils; +import org.jooq.DSLContext; + +/** + * Transfer non ehr bound data + */ +public class EhrSchemaData { + + public static final String ANONYMOUS_USER = "anonymousUser"; + + public record TemplateData(String templateId, String content, Timestamp creation) {} + + Map templateByTemplateId; + + @JsonIgnore + Map templateUuids = new HashMap<>(); + + List users; + + System system; + + // loaded from the import system + @JsonIgnore + private UUID defaultUser; + + // loaded from the import system + @JsonIgnore + private final Map> userMap = new HashMap<>(); + + public Stream streamTemplates() { + return templateByTemplateId.values().stream(); + } + + public TemplateData getTemplateByTemplateId(String templateId) { + return templateByTemplateId.get(templateId); + } + + public void setTemplates(List templates) { + templateByTemplateId = templates.stream().collect(Collectors.toMap(TemplateData::templateId, t -> t)); + } + + public UUID getTemplateUuid(TemplateData t) { + return templateUuids.computeIfAbsent(t, tt -> UUID.randomUUID()); + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public System getSystem() { + return system; + } + + public void setSystem(System system) { + this.system = system; + } + + public Pair findCommitterUser(PartyProxy partyProxy, DSLContext dslContext) { + + return Optional.ofNullable(partyProxy) + .map(MigrationUtils::getPartyProxyUuid) + // does a corresponding user exist? + .flatMap(u -> userMap.computeIfAbsent(u, id -> dslContext + .select(USERS.ID) + .from(USERS) + .where(USERS.ID.eq(id)) + .fetchOptional(USERS.ID))) + // if a user is found take it. + .map(u -> Pair.of(u, (PartyProxy) null)) + .orElseGet(() -> Pair.of(findDefaultUser(dslContext), partyProxy)); + } + + private UUID findDefaultUser(DSLContext dslContext) { + if (defaultUser == null) { + defaultUser = dslContext + .select(USERS.ID) + .from(USERS) + .where(USERS.USERNAME.eq(ANONYMOUS_USER)) + .fetchOne(USERS.ID); + } + + return defaultUser; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/dto/ExtendedEhr.java b/service/src/main/java/org/ehrbase/migration/dto/ExtendedEhr.java new file mode 100644 index 0000000..1576b0a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/ExtendedEhr.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import java.util.List; +import java.util.UUID; + +public class ExtendedEhr { + + private UUID ehrId; + private List contributions; + + private VersionedObjectData ehrStatus; + + private List> compositions; + + private UUID directory; + + private List> folders; + + private DvDateTime timeCreated; + + public UUID getEhrId() { + return ehrId; + } + + public void setEhrId(UUID ehrId) { + this.ehrId = ehrId; + } + + public List getContributions() { + return contributions; + } + + public void setContributions(List contributions) { + this.contributions = contributions; + } + + public VersionedObjectData getEhrStatus() { + return ehrStatus; + } + + public void setEhrStatus(VersionedObjectData ehrStatus) { + this.ehrStatus = ehrStatus; + } + + public List> getCompositions() { + return compositions; + } + + public void setCompositions(List> compositions) { + this.compositions = compositions; + } + + public List> getFolders() { + return folders; + } + + public void setFolders(List> folders) { + this.folders = folders; + } + + public UUID getDirectory() { + return directory; + } + + public void setDirectory(UUID directory) { + this.directory = directory; + } + + public DvDateTime getTimeCreated() { + return timeCreated; + } + + public void setTimeCreated(DvDateTime timeCreated) { + this.timeCreated = timeCreated; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/dto/SetToSortedSetConverter.java b/service/src/main/java/org/ehrbase/migration/dto/SetToSortedSetConverter.java new file mode 100644 index 0000000..c9a652a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/SetToSortedSetConverter.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +import static org.ehrbase.migration.exporter.v0.CompositionExporter.ORIGINAL_VERSION_COMPARATOR; + +import com.fasterxml.jackson.databind.util.StdConverter; +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * During deserialize we need to restore the ordering + */ +public class SetToSortedSetConverter + extends StdConverter>>, Map>>> { + + @Override + public Map>> convert(Map>> value) { + return value.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> toSortedSet(e.getValue()))); + } + + private SortedSet> toSortedSet(Set> value) { + TreeSet> versions = new TreeSet<>(ORIGINAL_VERSION_COMPARATOR); + versions.addAll(value); + return versions; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/dto/System.java b/service/src/main/java/org/ehrbase/migration/dto/System.java new file mode 100644 index 0000000..5265da5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/System.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +import java.util.UUID; + +public record System(UUID id, String description, String settings) {} diff --git a/service/src/main/java/org/ehrbase/migration/dto/User.java b/service/src/main/java/org/ehrbase/migration/dto/User.java new file mode 100644 index 0000000..ed3397a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/User.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +import com.nedap.archie.rm.generic.PartyIdentified; +import java.util.Objects; +import java.util.UUID; + +public class User { + + /** + * Old ehrbase: party id + */ + private final UUID id; + + private final String username; + private PartyIdentified partyIdentified; + + public User(UUID id, String username, PartyIdentified partyIdentified) { + this.id = id; + this.username = username; + this.partyIdentified = partyIdentified; + } + + public UUID getId() { + return id; + } + + public String getUsername() { + return username; + } + + public PartyIdentified getPartyIdentified() { + return partyIdentified; + } + + public void setPartyIdentified(PartyIdentified partyIdentified) { + this.partyIdentified = partyIdentified; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) return true; + if (obj == null || obj.getClass() != this.getClass()) return false; + var that = (User) obj; + return Objects.equals(this.username, that.username) + && Objects.equals(this.partyIdentified, that.partyIdentified); + } + + @Override + public int hashCode() { + return Objects.hash(username, partyIdentified); + } + + @Override + public String toString() { + return "User[" + "username=" + username + ", " + "partyIdentified=" + partyIdentified + ']'; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/dto/VersionedObjectData.java b/service/src/main/java/org/ehrbase/migration/dto/VersionedObjectData.java new file mode 100644 index 0000000..cde9e09 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/dto/VersionedObjectData.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.dto; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import java.util.SortedSet; +import java.util.UUID; + +public record VersionedObjectData( + UUID uuid, + @JsonDeserialize(converter = SetToSortedSetConverter.class) SortedSet> originalVersions) {} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/ExportService.java b/service/src/main/java/org/ehrbase/migration/exporter/ExportService.java new file mode 100644 index 0000000..62e621c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/ExportService.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter; + +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.dto.VersionedObjectData; + +/** + * The ExportService is stateful (currentTenant). + */ +public interface ExportService { + + List getTenants(); + + int getEhrCount(); + + List findEhrs(int start, int count); + + void setCurrentTenant(EhrSchema ehrSchema); + + Map>> findCompositions(Collection uuids, EhrSchema tenant); + + Map>> findStatus(Collection uuids, EhrSchema tenant); + + Map>> findFolder(Collection uuids, EhrSchema tenant); + + Map> findContributions(Collection ehrIds); + + EhrSchemaData findEhrSchemaData(); + + void postProcess(ExtendedEhr ehr); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/ExportServiceConfiguration.java b/service/src/main/java/org/ehrbase/migration/exporter/ExportServiceConfiguration.java new file mode 100644 index 0000000..0051efe --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/ExportServiceConfiguration.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter; + +import org.ehrbase.migration.config.ExportDatasourceConfiguration; +import org.ehrbase.migration.exporter.v0.ExportServiceV0Imp; +import org.jooq.DSLContext; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ExportServiceConfiguration { + + @Bean + @ConditionalOnBean(name = "exportDslContext") + ExportService exportService( + @Qualifier("exportDslContext") DSLContext context, + ExportDatasourceConfiguration.TenantHandlingExportConnectionProvider connectionProvider) { + return new ExportServiceV0Imp(context, connectionProvider); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/EhrStatusPostprocessor.java b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/EhrStatusPostprocessor.java new file mode 100644 index 0000000..9582b47 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/EhrStatusPostprocessor.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.postprocessor; + +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.ehr.EhrStatus; +import java.util.Collections; +import java.util.List; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; + +public class EhrStatusPostprocessor implements ExportPostprocessor { + @Override + public List postExport(ExtendedEhr ehr, EhrSchemaData ehrSchemaData, EhrSchema t) { + + ehr.getEhrStatus().originalVersions().forEach(this::updateArchetypeNodeId); + + return Collections.emptyList(); + } + + private void updateArchetypeNodeId(OriginalVersion ov) { + + if (!ov.getData().getArchetypeNodeId().startsWith("openEHR-EHR-EHR_STATUS.")) { + ov.getData().setArchetypeNodeId("openEHR-EHR-EHR_STATUS.generic.v1"); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ExportPostprocessor.java b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ExportPostprocessor.java new file mode 100644 index 0000000..970d622 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ExportPostprocessor.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.postprocessor; + +import java.util.List; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; + +public interface ExportPostprocessor { + + record MigrationError(String tenantId, String ehrId, String voId, String message) {} + + List postExport(ExtendedEhr ehr, EhrSchemaData ehrSchemaData, EhrSchema t); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/PostprocessorConfiguration.java b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/PostprocessorConfiguration.java new file mode 100644 index 0000000..0485e06 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/PostprocessorConfiguration.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.postprocessor; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class PostprocessorConfiguration { + + @Bean + @ConditionalOnProperty("export.postprocessors.validation.enable") + public ValidationPostprocessor validationPostprocessor() { + return new ValidationPostprocessor(); + } + + @Bean + public EhrStatusPostprocessor ehrStatusPostprocessor() { + return new EhrStatusPostprocessor(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ValidationPostprocessor.java b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ValidationPostprocessor.java new file mode 100644 index 0000000..c475cde --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/postprocessor/ValidationPostprocessor.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.postprocessor; + +import com.nedap.archie.query.RMPathQuery; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rmobjectvalidator.APathQueryCache; +import com.nedap.archie.rmobjectvalidator.RMObjectValidator; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import org.apache.xmlbeans.XmlException; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.openehr.sdk.validation.CompositionValidator; +import org.ehrbase.openehr.sdk.validation.ConstraintViolationException; +import org.ehrbase.openehr.sdk.validation.ValidationException; +import org.ehrbase.openehr.sdk.webtemplate.model.WebTemplate; +import org.ehrbase.openehr.sdk.webtemplate.templateprovider.TemplateProvider; +import org.openehr.schemas.v1.OPERATIONALTEMPLATE; + +/** + * Validate all {@link Composition} + */ +public class ValidationPostprocessor implements ExportPostprocessor { + + private final Map rmPathQueryCache = new ConcurrentHashMap<>(); + + private final Map templateCache = new ConcurrentHashMap<>(); + + private final ThreadLocal compositionValidator; + + public ValidationPostprocessor() { + compositionValidator = ThreadLocal.withInitial(this::createCompositionValidator); + } + + TemplateProvider createTemplateProvider(EhrSchemaData ehrSchemaData) { + return templateId -> Optional.of(ehrSchemaData.getTemplateByTemplateId(templateId)) + .map(td -> templateCache.computeIfAbsent(td.templateId(), s -> { + try { + return org.openehr.schemas.v1.TemplateDocument.Factory.parse(td.content()) + .getTemplate(); + } catch (XmlException e) { + throw new RuntimeException(e); + } + })); + } + + @Override + public List postExport(ExtendedEhr ehr, EhrSchemaData ehrSchemaData, EhrSchema t) { + + List migrationErrorList = new ArrayList<>(); + + if (ehr.getCompositions() != null) { + TemplateProvider templateProvider = createTemplateProvider(ehrSchemaData); + + ehr.getCompositions().stream() + .map(VersionedObjectData::originalVersions) + .flatMap(Collection::stream) + .map(OriginalVersion::getData) + .filter(Objects::nonNull) + .forEach(d -> validate(ehr.getEhrId().toString(), d, templateProvider, migrationErrorList)); + } + + return migrationErrorList; + } + + private void validate( + String ehrId, + Composition composition, + TemplateProvider templateProvider, + List migrationErrorList) { + try { + check(composition, templateProvider); + } catch (ValidationException v) { + + migrationErrorList.add(new MigrationError( + null, ehrId, composition.getUid().getValue(), "Template Validation for composition failed")); + + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public void check(String templateID, Composition composition, TemplateProvider templateProvider) throws Exception { + WebTemplate webTemplate; + try { + webTemplate = templateProvider.buildIntrospect(templateID).orElseThrow(); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e.getMessage()); + } + + // Validate the composition based on WebTemplate + var constraintViolations = compositionValidator.get().validate(composition, webTemplate); + if (!constraintViolations.isEmpty()) { + throw new ConstraintViolationException(constraintViolations); + } + } + + public void check(Composition composition, TemplateProvider templateProvider) throws Exception { + // check if this composition is valid for processing + if (composition.getName() == null) { + throw new IllegalArgumentException("Composition missing mandatory attribute: name"); + } + if (composition.getArchetypeNodeId() == null) { + throw new IllegalArgumentException("Composition missing mandatory attribute: archetype_node_id"); + } + if (composition.getLanguage() == null) { + throw new IllegalArgumentException("Composition missing mandatory attribute: language"); + } + if (composition.getCategory() == null) { + throw new IllegalArgumentException("Composition missing mandatory attribute: category"); + } + if (composition.getComposer() == null) { + throw new IllegalArgumentException("Composition missing mandatory attribute: composer"); + } + if (composition.getArchetypeDetails() == null) { + throw new IllegalArgumentException("Composition missing mandatory attribute: archetype details"); + } + if (composition.getArchetypeDetails().getTemplateId() == null) { + throw new IllegalArgumentException( + "Composition missing mandatory attribute: archetype details/template_id"); + } + + check(composition.getArchetypeDetails().getTemplateId().getValue(), composition, templateProvider); + } + + private CompositionValidator createCompositionValidator() { + APathQueryCache delegator = new APathQueryCache() { + @Override + public RMPathQuery getApathQuery(String query) { + return rmPathQueryCache.computeIfAbsent(query, RMPathQuery::new); + } + }; + CompositionValidator validator = new CompositionValidator(); + + setSharedAPathQueryCache(validator, delegator); + return validator; + } + + private static void setSharedAPathQueryCache(CompositionValidator validator, APathQueryCache delegator) { + if (delegator == null) { + return; + } + try { + // as RMObjectValidator.queryCache is hard-coded, it is replaced via reflection + Field queryCacheField = RMObjectValidator.class.getDeclaredField("queryCache"); + queryCacheField.setAccessible(true); + queryCacheField.set(validator.getRmObjectValidator(), delegator); + } catch (IllegalAccessException | NoSuchFieldException e) { + throw new RuntimeException("Failed to inject shared RMPathQuery cache", e); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/AuditExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/AuditExporter.java new file mode 100644 index 0000000..ed92cb4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/AuditExporter.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.datavalues.DvText; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import com.nedap.archie.rm.support.identification.TerminologyId; +import java.sql.Timestamp; +import java.time.ZoneId; +import java.util.Locale; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; + +public class AuditExporter { + + public static com.nedap.archie.rm.generic.AuditDetails to(AuditDetailsRecord auditDetailsRecord) { + com.nedap.archie.rm.generic.AuditDetails auditDetails = new com.nedap.archie.rm.generic.AuditDetails(); + + auditDetails.setSystemId(auditDetailsRecord.getSystemId().toString()); + + auditDetails.setDescription(new DvText(auditDetailsRecord.getDescription())); + + ContributionChangeType contributionChangeType = ContributionChangeType.valueOf( + auditDetailsRecord.getChangeType().getLiteral().toUpperCase()); + DvCodedText changeType = convert(contributionChangeType); + auditDetails.setChangeType(changeType); + + Timestamp committed = auditDetailsRecord.getTimeCommitted(); + String tzid = auditDetailsRecord.getTimeCommittedTzid(); + DvDateTime timeCommitted = to(committed, tzid); + + auditDetails.setTimeCommitted(timeCommitted); + auditDetails.setCommitter(PartyExporter.buildDummy(auditDetailsRecord.getCommitter())); + return auditDetails; + } + + protected static DvDateTime to(Timestamp committed, String tzid) { + return new DvDateTime(committed.toInstant().atZone(ZoneId.of(tzid)).toOffsetDateTime()); + } + + static DvCodedText convert(ContributionChangeType contributionChangeType) { + DvCodedText changeType = new DvCodedText( + contributionChangeType.name().toLowerCase(Locale.ROOT), + new CodePhrase(new TerminologyId("openehr"), Integer.toString(contributionChangeType.getCode()))); + return changeType; + } + + public enum ContributionChangeType { + CREATION(249), + AMENDMENT(250), + MODIFICATION(251), + SYNTHESIS(252), + UNKNOWN(253), + DELETED(523); + final int code; + + ContributionChangeType(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/CompositionExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/CompositionExporter.java new file mode 100644 index 0000000..1c2999b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/CompositionExporter.java @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.AUDIT_DETAILS; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.ENTRY; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.EVENT_CONTEXT; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.PARTICIPATION_HISTORY; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.TERRITORY; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.Composition.COMPOSITION; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompositionHistory.COMPOSITION_HISTORY; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.EntryHistory.ENTRY_HISTORY; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContextHistory.EVENT_CONTEXT_HISTORY; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.Participation.PARTICIPATION; + +import com.nedap.archie.rm.archetyped.Archetyped; +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.archetyped.TemplateId; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.datastructures.ItemStructure; +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.datavalues.quantity.DvInterval; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import com.nedap.archie.rm.support.identification.ArchetypeID; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectRef; +import com.nedap.archie.rm.support.identification.ObjectVersionId; +import com.nedap.archie.rm.support.identification.TerminologyId; +import java.sql.Timestamp; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.TreeSet; +import java.util.UUID; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RawJson; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.rmobject.FeederAuditEncoding; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.rmobject.LinksEncoding; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompositionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EntryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EventContextRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ParticipationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.DSLContext; +import org.jooq.JSONB; +import org.jooq.Record; +import org.jooq.Result; + +public class CompositionExporter { + + private final DSLContext dslContext; + private final EhrSchemaDataExporter ehrSchemaDataExporter; + private final PartyExporter partyExporter; + + private final Map territoryMap; + + /** + * Since old ehrbase has only an implicit version, it is derived from ordering by commit time + */ + public static final Comparator> ORIGINAL_VERSION_COMPARATOR = Comparator.comparing( + v -> (OffsetDateTime) v.getCommitAudit().getTimeCommitted().getValue()); + + public CompositionExporter(DSLContext dslContext) { + this.dslContext = dslContext; + this.ehrSchemaDataExporter = new EhrSchemaDataExporter(dslContext); + this.partyExporter = new PartyExporter(dslContext); + + territoryMap = dslContext + .select(TERRITORY.CODE, TERRITORY.TWOLETTER) + .from(TERRITORY) + .fetchMap(TERRITORY.CODE, TERRITORY.TWOLETTER); + } + + protected Map>> findCompositions( + Collection ehrIds, EhrSchema tenant) { + Result fetch = dslContext + .select(COMPOSITION.fields()) + .select(ENTRY.fields()) + .select(PARTICIPATION.fields()) + .select(EVENT_CONTEXT.fields()) + .select(AUDIT_DETAILS.fields()) + .from(COMPOSITION) + // optional in case of delete + .leftJoin(ENTRY) + .on(COMPOSITION.ID.eq(ENTRY.COMPOSITION_ID)) + .join(AUDIT_DETAILS) + .on(COMPOSITION.HAS_AUDIT.eq(AUDIT_DETAILS.ID)) + // optional in RM modell + .leftJoin(EVENT_CONTEXT) + .on(EVENT_CONTEXT + .COMPOSITION_ID + .eq(COMPOSITION.ID) + .and(EVENT_CONTEXT.SYS_TRANSACTION.eq(COMPOSITION.SYS_TRANSACTION))) + // optional in RM modell + .leftJoin(PARTICIPATION) + .on(EVENT_CONTEXT + .ID + .eq(PARTICIPATION.EVENT_CONTEXT) + .and(PARTICIPATION.SYS_TRANSACTION.eq(COMPOSITION.SYS_TRANSACTION))) + .where(COMPOSITION.EHR_ID.in(ehrIds)) + .unionAll(dslContext + .select(COMPOSITION_HISTORY.fields(COMPOSITION.fields())) + .select(ENTRY_HISTORY.fields(ENTRY.fields())) + .select(PARTICIPATION_HISTORY.fields(PARTICIPATION.fields())) + .select(EVENT_CONTEXT_HISTORY.fields(EVENT_CONTEXT.fields())) + .select(AUDIT_DETAILS.fields()) + .from(COMPOSITION_HISTORY) + .leftJoin(ENTRY_HISTORY) + .on(COMPOSITION_HISTORY + .ID + .eq(ENTRY_HISTORY.COMPOSITION_ID) + .and(COMPOSITION_HISTORY.SYS_TRANSACTION.eq(ENTRY_HISTORY.SYS_TRANSACTION))) + .join(AUDIT_DETAILS) + .on(COMPOSITION_HISTORY.HAS_AUDIT.eq(AUDIT_DETAILS.ID)) + .leftJoin(EVENT_CONTEXT_HISTORY) + .on(EVENT_CONTEXT_HISTORY + .COMPOSITION_ID + .eq(COMPOSITION_HISTORY.ID) + .and(EVENT_CONTEXT_HISTORY.SYS_TRANSACTION.eq(COMPOSITION_HISTORY.SYS_TRANSACTION))) + .leftJoin(PARTICIPATION_HISTORY) + .on(EVENT_CONTEXT_HISTORY + .ID + .eq(PARTICIPATION_HISTORY.EVENT_CONTEXT) + .and(PARTICIPATION_HISTORY.SYS_TRANSACTION.eq(COMPOSITION_HISTORY.SYS_TRANSACTION))) + .where(COMPOSITION_HISTORY.EHR_ID.in(ehrIds))) + .fetch(); + + // Reduce the result so we get for each Composition an Array of ParticipationRecord + Map>>> + compositionRecordOptionalMap = fetch.stream() + .map(r -> Triple.of( + r.into(CompositionRecord.class), + r, + new ArrayList<>(Collections.singletonList(r.into(ParticipationRecord.class))))) + .collect(Collectors.groupingBy(Triple::getLeft, Collectors.reducing((t1, t2) -> { + t1.getRight().addAll(t2.getRight()); + return Triple.of(t1.getLeft(), t1.getMiddle(), t1.getRight()); + }))); + + // Create a Map ehrId -> compositionId -> Set of versions order by commit_audit.time_committed.value + // (OffsetDateTime) + Map>> collect = compositionRecordOptionalMap.values().stream() + .map(o -> this.toOriginalVersion(o.get().getMiddle(), o.get().getRight())) + .collect(groupingVersionedObjectsByEhrIdCollector()); + + // since old ehrbase has only a implicit version we need to create the version by ordering by time. + ehrSchemaDataExporter.addVersion(collect, tenant); + // we fetch and add parties as batch + partyExporter.addParty(collect); + + return collect; + } + + private Pair> toOriginalVersion( + Record triple, ArrayList participations) { + + OriginalVersion originalVersion = new OriginalVersion<>(); + CompositionRecord compositionRecord = triple.into(CompositionRecord.class); + EntryRecord entryRecord = triple.into(EntryRecord.class); + AuditDetailsRecord auditDetailsRecord = triple.into(AuditDetailsRecord.class); + EventContextRecord eventContextRecord = triple.into(EventContextRecord.class); + + // Version will be added later + originalVersion.setUid(new ObjectVersionId(compositionRecord.getId().toString())); + originalVersion.setContribution(new ObjectRef<>( + new HierObjectId(compositionRecord.getInContribution().toString()), "local", "CONTRIBUTION")); + originalVersion.setCommitAudit(AuditExporter.to(auditDetailsRecord)); + + if (!originalVersion + .getCommitAudit() + .getChangeType() + .getDefiningCode() + .getCodeString() + .equals("" + AuditExporter.ContributionChangeType.DELETED.code)) { + originalVersion.setData( + new RawJson().unmarshal(entryRecord.getEntry().data())); + Composition data = originalVersion.getData(); + data.setUid(originalVersion.getUid()); + data.setLanguage(new CodePhrase(new TerminologyId("ISO_639-1"), compositionRecord.getLanguage())); + data.setTerritory(new CodePhrase( + new TerminologyId("ISO_3166-1"), territoryMap.get(compositionRecord.getTerritory()))); + data.setCategory((DvCodedText) EhrSchemaDataExporter.to(entryRecord.getCategory())); + data.setFeederAudit(Optional.ofNullable(compositionRecord.getFeederAudit()) + .map(JSONB::data) + .map(Object::toString) + .map(s -> new FeederAuditEncoding().fromDB(s)) + .orElse(null)); + data.setLinks(Optional.ofNullable(compositionRecord.getLinks()) + .map(JSONB::data) + .map(Object::toString) + .map(s -> new LinksEncoding().fromDB(s)) + .orElse(null)); + + Archetyped archetypeDetails = new Archetyped(); + TemplateId templateId = new TemplateId(); + templateId.setValue(entryRecord.getTemplateId()); + archetypeDetails.setTemplateId(templateId); + archetypeDetails.setArchetypeId(new ArchetypeID(entryRecord.getArchetypeId())); + archetypeDetails.setRmVersion(entryRecord.getRmVersion()); + data.setArchetypeDetails(archetypeDetails); + + // Will be replaced later + data.setComposer(PartyExporter.buildDummy(compositionRecord.getComposer())); + + if (eventContextRecord.getId() != null) { + data.setContext(to(eventContextRecord)); + data.getContext() + .setParticipations(participations.stream() + .filter(p -> p.getId() != null) + .map(CompositionExporter::to) + .toList()); + } + } + + return Pair.of(compositionRecord.getEhrId(), originalVersion); + } + + private static com.nedap.archie.rm.composition.EventContext to(EventContextRecord eventContextRecord) { + + ItemStructure otherContext = null; + + if (eventContextRecord.getOtherContext() != null) { + otherContext = new RawJson() + .unmarshal((eventContextRecord.getOtherContext().data()), ItemStructure.class); + } + + DvCodedTextRecord dvCodedTextRecord = eventContextRecord.getSetting(); + + UUID composer = eventContextRecord.getFacility(); + + Timestamp timestamp = eventContextRecord.getEndTime(); + String timezone = eventContextRecord.getEndTimeTzid(); + + Timestamp timestamp1 = eventContextRecord.getStartTime(); + String timezone1 = eventContextRecord.getStartTimeTzid(); + + return new com.nedap.archie.rm.composition.EventContext( + PartyExporter.buildDummy(composer), + EhrSchemaDataExporter.decodeDvDateTime(timestamp1, timezone1), + EhrSchemaDataExporter.decodeDvDateTime(timestamp, timezone), + null, + eventContextRecord.getLocation(), + (DvCodedText) EhrSchemaDataExporter.to(dvCodedTextRecord), + otherContext); + } + + private static com.nedap.archie.rm.generic.Participation to(ParticipationRecord participationRecord) { + + DvInterval interval; + if (participationRecord.getTimeLower() != null) { + // time null value is allowed for participation + Timestamp timestamp = participationRecord.getTimeUpper(); + String timezone = participationRecord.getTimeUpperTz(); + + Timestamp timestamp1 = participationRecord.getTimeLower(); + String timezone1 = participationRecord.getTimeLowerTz(); + + interval = new DvInterval<>( + EhrSchemaDataExporter.decodeDvDateTime(timestamp1, timezone1), + EhrSchemaDataExporter.decodeDvDateTime(timestamp, timezone)); + } else { + interval = null; + } + DvCodedText mode; + if (participationRecord.getMode() != null) { + DvCodedTextRecord dvCodedTextRecord = participationRecord.getMode(); + + mode = (DvCodedText) EhrSchemaDataExporter.to(dvCodedTextRecord); + } else { + mode = null; + } + + DvCodedTextRecord dvCodedTextRecord = participationRecord.getFunction(); + + UUID composer = participationRecord.getPerformer(); + + return new com.nedap.archie.rm.generic.Participation( + PartyExporter.buildDummy(composer), EhrSchemaDataExporter.to(dvCodedTextRecord), mode, interval); + } + + protected static + Collector>, ?, Map>>> + groupingVersionedObjectsByEhrIdCollector() { + + Collector>, ?, Map>>> c = + Collectors.groupingBy(Pair::getLeft, Collectors.mapping(Pair::getRight, Collectors.toList())); + return Collectors.collectingAndThen(c, a -> a.entrySet().stream() + .collect(Collectors.toMap(Entry::getKey, e -> toVersionedObjectDataList(e.getValue())))); + } + + private static List> toVersionedObjectDataList( + final List> versions) { + return versions.stream() + .collect(Collectors.groupingBy( + p -> UUID.fromString(p.getUid().getRoot().getValue()))) + .entrySet() + .stream() + .map(e -> new VersionedObjectData<>( + e.getKey(), + e.getValue().stream() + .collect(Collectors.toCollection(() -> new TreeSet<>(ORIGINAL_VERSION_COMPARATOR))))) + .toList(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/ContributionExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/ContributionExporter.java new file mode 100644 index 0000000..6dde18e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/ContributionExporter.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import static org.ehrbase.migration.MigrationUtils.getPartyProxyUuid; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.AuditDetails.AUDIT_DETAILS; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.Contribution.CONTRIBUTION; + +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.generic.PartyProxy; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectRef; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ContributionRecord; +import org.jooq.DSLContext; + +class ContributionExporter { + + private final DSLContext dslContext; + + private final PartyExporter partyExporter; + + public ContributionExporter(DSLContext dslContext) { + this.dslContext = dslContext; + this.partyExporter = new PartyExporter(dslContext); + } + + protected Map> findContributions(Collection ehrIds) { + + Map> collect = dslContext + .select(CONTRIBUTION.fields()) + .select(AUDIT_DETAILS.fields()) + .from(CONTRIBUTION) + .join(AUDIT_DETAILS) + .on(CONTRIBUTION.HAS_AUDIT.eq(AUDIT_DETAILS.ID)) + .where(CONTRIBUTION.EHR_ID.in(ehrIds)) + .stream() + .map(r -> to(r.into(ContributionRecord.class), r.into(AuditDetailsRecord.class))) + .collect(Collectors.groupingBy(Pair::getKey, Collectors.mapping(Pair::getValue, Collectors.toList()))); + + Map>> consumers = collect.values().stream() + .flatMap(List::stream) + .map(c -> { + Consumer committerConsumer = c.getAudit()::setCommitter; + return Pair.of(getPartyProxyUuid(c.getAudit().getCommitter()), committerConsumer); + }) + .collect(Collectors.groupingBy(Pair::getKey, Collectors.mapping(Pair::getRight, Collectors.toList()))); + + Map partyById = partyExporter.findParties(consumers.keySet()); + + consumers.forEach((k, v) -> { + v.forEach(c -> { + if (partyById.containsKey(k)) { + c.accept(partyById.get(k)); + } + }); + }); + + return collect; + } + + private static Pair to( + ContributionRecord contributionRecord, AuditDetailsRecord auditDetailsRecord) { + Contribution contribution = new Contribution(); + + contribution.setAudit(AuditExporter.to(auditDetailsRecord)); + contribution.setUid(new HierObjectId(contributionRecord.getId().toString())); + + return Pair.of(contributionRecord.getEhrId(), contribution); + } + + static void addVersionRef(Contribution contribution, OriginalVersion version, String type) { + contribution.getVersions().add(new ObjectRef<>(version.getUid(), "local", type)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrExporter.java new file mode 100644 index 0000000..8e0aec1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrExporter.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import java.util.List; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrRecord; +import org.jooq.DSLContext; + +class EhrExporter { + + private final DSLContext dslContext; + + public EhrExporter(DSLContext dslContext) { + this.dslContext = dslContext; + } + + protected List findEhrs(int start, int count) { + List ehrs = + dslContext.selectFrom(Ehr.EHR_).orderBy(Ehr.EHR_.ID).offset(start).limit(count).fetch().stream() + .map(EhrExporter::to) + .toList(); + if (ehrs.size() != count) { + throw new IllegalStateException( + "%s EHRs were requested, but %s were returned".formatted(count, ehrs.size())); + } + return ehrs; + } + + private static ExtendedEhr to(EhrRecord record) { + ExtendedEhr extendedEhr = new ExtendedEhr(); + extendedEhr.setEhrId(record.getId()); + extendedEhr.setTimeCreated(AuditExporter.to(record.getDateCreated(), record.getDateCreatedTzid())); + + return extendedEhr; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrSchemaDataExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrSchemaDataExporter.java new file mode 100644 index 0000000..2d559d9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrSchemaDataExporter.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import static org.ehrbase.migration.MigrationUtils.getPartyProxyUuid; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.SYSTEM; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.TEMPLATE_STORE; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.USERS; + +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.datavalues.DvText; +import com.nedap.archie.rm.datavalues.TermMapping; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import com.nedap.archie.rm.generic.PartyIdentified; +import com.nedap.archie.rm.generic.PartyProxy; +import com.nedap.archie.rm.support.identification.TerminologyId; +import java.sql.Timestamp; +import java.time.ZoneOffset; +import java.time.temporal.TemporalAccessor; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.System; +import org.ehrbase.migration.dto.User; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.SystemRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.UsersRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.CodePhraseRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.DSLContext; + +class EhrSchemaDataExporter { + + private final DSLContext dslContext; + private final PartyExporter partyExporter; + + private final Map systemIdMap = new ConcurrentHashMap<>(); + + EhrSchemaDataExporter(DSLContext dslContext) { + this.dslContext = dslContext; + partyExporter = new PartyExporter(dslContext); + } + + protected void addVersion( + Map>> versionedObjects, EhrSchema tenant) { + String systemId = getSystemId(tenant); + versionedObjects + .values() + .forEach(e -> e.forEach(s -> { + int i = 1; + for (OriginalVersion v : s.originalVersions()) { + v.getUid().setValue(v.getUid().getValue() + "::" + systemId + "::" + i); + i++; + } + })); + } + + protected String getSystemId(EhrSchema ehrSchema) { + return systemIdMap.computeIfAbsent(ehrSchema, t -> { + return dslContext + .select(SYSTEM.SETTINGS) + .from(SYSTEM) + // other systems could be saved do to missing validation but all data should only have the default + // system id + .where(SYSTEM.DESCRIPTION.eq("DEFAULT RUNNING SYSTEM")) + .fetchSingle() + .value1(); + }); + } + + protected EhrSchemaData getEhrSchemaData() { + EhrSchemaData ehrSchemaData = new EhrSchemaData(); + + ehrSchemaData.setSystem(getSystem()); + ehrSchemaData.setTemplates(getTemplates()); + ehrSchemaData.setUsers(getUsers()); + + return ehrSchemaData; + } + + private List getUsers() { + + Map byParty = dslContext.select(USERS.fields()).from(USERS).fetch().into(UsersRecord.class).stream() + .map(r -> new User(r.getPartyId(), r.getUsername(), PartyExporter.buildDummy(r.getPartyId()))) + .collect(Collectors.toMap(u -> getPartyProxyUuid(u.getPartyIdentified()), Function.identity())); + + Map party = partyExporter.findParties(byParty.keySet()); + + byParty.forEach((k, v) -> v.setPartyIdentified((PartyIdentified) party.get(k))); + + return new ArrayList<>(byParty.values()); + } + + private List getTemplates() { + return dslContext + .select(TEMPLATE_STORE.TEMPLATE_ID, TEMPLATE_STORE.CONTENT, TEMPLATE_STORE.SYS_TRANSACTION) + .from(TEMPLATE_STORE) + .fetch() + .stream() + .map(r -> new EhrSchemaData.TemplateData(r.component1(), r.component2(), r.component3())) + .toList(); + } + + private System getSystem() { + SystemRecord defaultRunningSystem = dslContext + .selectFrom(SYSTEM) + // other systems could be saved do to missing validation but all data should only have the default + // system id + .where(SYSTEM.DESCRIPTION.eq("DEFAULT RUNNING SYSTEM")) + .fetchSingle(); + + return new System( + defaultRunningSystem.getId(), + defaultRunningSystem.getDescription(), + defaultRunningSystem.getSettings()); + } + + protected static DvText to(DvCodedTextRecord dvCodedTextRecord) { + + final DvText retObject; + + CodePhraseRecord codePhraseDefiningCode = dvCodedTextRecord.getDefiningCode(); + CodePhraseRecord codePhraseLanguage = dvCodedTextRecord.getLanguage(); + CodePhraseRecord codePhraseEncoding = dvCodedTextRecord.getEncoding(); + + if (codePhraseDefiningCode != null) { + retObject = new DvCodedText( + dvCodedTextRecord.getValue(), + codePhraseLanguage == null + ? null + : new CodePhrase( + new TerminologyId(codePhraseLanguage.getTerminologyIdValue()), + codePhraseLanguage.getCodeString()), + codePhraseEncoding == null + ? null + : new CodePhrase( + new TerminologyId(codePhraseEncoding.getTerminologyIdValue()), + codePhraseEncoding.getCodeString()), + new CodePhrase( + new TerminologyId(codePhraseDefiningCode.getTerminologyIdValue()), + codePhraseDefiningCode.getCodeString())); + } else { // assume DvText + retObject = new DvText( + dvCodedTextRecord.getValue(), + codePhraseLanguage == null + ? null + : new CodePhrase( + new TerminologyId(codePhraseLanguage.getTerminologyIdValue()), + codePhraseLanguage.getCodeString()), + codePhraseEncoding == null + ? null + : new CodePhrase( + new TerminologyId(codePhraseEncoding.getTerminologyIdValue()), + codePhraseEncoding.getCodeString())); + } + + if (dvCodedTextRecord.getTermMapping() != null) { + for (String dvCodedTextTermMappingRecord : dvCodedTextRecord.getTermMapping()) { + + String[] attributes = dvCodedTextTermMappingRecord.split("\\|"); + + (retObject) + .addMapping(new TermMapping( + new CodePhrase(new TerminologyId(attributes[4]), attributes[5]), + attributes[0].charAt(0), + new DvCodedText( + attributes[1], + new CodePhrase(new TerminologyId(attributes[2]), attributes[3])))); + } + } + + return retObject; + } + + public static DvDateTime decodeDvDateTime(Timestamp timestamp, String timezone) { + if (timestamp == null) { + return null; + } + + TemporalAccessor temporal; + if (timezone != null) { + temporal = timestamp.toLocalDateTime().atOffset(ZoneOffset.of(timezone)); + } else { + temporal = timestamp.toLocalDateTime(); + } + return new DvDateTime(temporal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrStatusExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrStatusExporter.java new file mode 100644 index 0000000..c53b091 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/EhrStatusExporter.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.*; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.STATUS_HISTORY; + +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.ehr.EhrStatus; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectRef; +import com.nedap.archie.rm.support.identification.ObjectVersionId; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StatusRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.DSLContext; + +class EhrStatusExporter { + + private final DSLContext dslContext; + private final EhrSchemaDataExporter ehrSchemaDataExporter; + private final PartyExporter partyExporter; + + public EhrStatusExporter(DSLContext dslContext) { + this.dslContext = dslContext; + this.ehrSchemaDataExporter = new EhrSchemaDataExporter(dslContext); + this.partyExporter = new PartyExporter(dslContext); + } + + protected Map>> findStatus(Collection ehrIds, EhrSchema tenant) { + + // Create a Map ehrId -> statusId -> Set of versions order by version number + Map>> collect = dslContext + .select(STATUS.fields()) + .select(AUDIT_DETAILS.fields()) + .from(STATUS) + .join(AUDIT_DETAILS) + .on(STATUS.HAS_AUDIT.eq(AUDIT_DETAILS.ID)) + .where(STATUS.EHR_ID.in(ehrIds)) + .unionAll(dslContext + .select(STATUS_HISTORY.fields(STATUS.fields())) + .select(AUDIT_DETAILS.fields()) + .from(STATUS_HISTORY) + .join(AUDIT_DETAILS) + .on(STATUS_HISTORY.HAS_AUDIT.eq(AUDIT_DETAILS.ID)) + .where(STATUS_HISTORY.EHR_ID.in(ehrIds))) + .fetch() + .stream() + .map(r -> to(r.into(StatusRecord.class), r.into(AuditDetailsRecord.class))) + .collect(CompositionExporter.groupingVersionedObjectsByEhrIdCollector()); + + // since old ehrbase has only a implicit version we need to create the version by ordering by time. + ehrSchemaDataExporter.addVersion(collect, tenant); + // we fetch and add parties as batch + partyExporter.addParty(collect); + + return collect; + } + + private static Pair> to( + StatusRecord ehrStatusRecord, AuditDetailsRecord auditDetailsRecord) { + + OriginalVersion originalVersion = new OriginalVersion<>(); + + originalVersion.setUid(new ObjectVersionId(ehrStatusRecord.getId().toString())); + originalVersion.setCommitAudit(AuditExporter.to(auditDetailsRecord)); + originalVersion.setContribution(new ObjectRef<>( + new HierObjectId(ehrStatusRecord.getInContribution().toString()), "local", "CONTRIBUTION")); + + EhrStatus status = new EhrStatus(); + status.setUid(originalVersion.getUid()); + + status.setModifiable(ehrStatusRecord.getIsModifiable()); + status.setQueryable(ehrStatusRecord.getIsQueryable()); + // set otherDetails if available + if (ehrStatusRecord.getOtherDetails() != null) { + status.setOtherDetails(ehrStatusRecord.getOtherDetails()); + } + + // Locatable attribute + status.setArchetypeNodeId(ehrStatusRecord.getArchetypeNodeId()); + DvCodedTextRecord dvCodedTextRecord = ehrStatusRecord.getName(); + + status.setName(EhrSchemaDataExporter.to(dvCodedTextRecord)); + + UUID composer = ehrStatusRecord.getParty(); + + status.setSubject(PartyExporter.buildDummySelf(composer)); + + originalVersion.setData(status); + + return Pair.of(ehrStatusRecord.getEhrId(), originalVersion); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/ExportServiceV0Imp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/ExportServiceV0Imp.java new file mode 100644 index 0000000..36ec341 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/ExportServiceV0Imp.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.changecontrol.Version; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectId; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.ehrbase.migration.config.ExportDatasourceConfiguration; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.ExportService; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TenantRecord; +import org.jooq.DSLContext; +import org.jooq.JSON; + +public class ExportServiceV0Imp implements ExportService { + + private final DSLContext dslContext; + private final ExportDatasourceConfiguration.TenantHandlingExportConnectionProvider connectionProvider; + + private final EhrSchemaDataExporter ehrSchemaDataExporter; + private final EhrExporter ehrExporter; + private final CompositionExporter compositionExporter; + private final EhrStatusExporter ehrStatusExporter; + + private final ContributionExporter contributionExporter; + + private final FolderExporter folderExporter; + + public ExportServiceV0Imp( + DSLContext dslContext, + ExportDatasourceConfiguration.TenantHandlingExportConnectionProvider connectionProvider) { + this.dslContext = dslContext; + this.ehrSchemaDataExporter = new EhrSchemaDataExporter(dslContext); + this.ehrExporter = new EhrExporter(dslContext); + this.compositionExporter = new CompositionExporter(dslContext); + this.ehrStatusExporter = new EhrStatusExporter(dslContext); + this.folderExporter = new FolderExporter(dslContext); + + this.contributionExporter = new ContributionExporter(dslContext); + this.connectionProvider = connectionProvider; + } + + @Override + public List getTenants() { + return dslContext + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.Tenant.TENANT) + .fetch() + .map(ExportServiceV0Imp::to); + } + + private static EhrSchema to(TenantRecord record) { + + return new EhrSchema( + (int) record.getId(), + Optional.ofNullable(record.getTenantProperties()) + .map(JSON::data) + .orElse(null), + record.getTenantName(), + record.getTenantId()); + } + + @Override + public void setCurrentTenant(EhrSchema ehrSchema) { + connectionProvider.setTenant(ehrSchema); + } + + @Override + public int getEhrCount() { + return dslContext.fetchCount(Ehr.EHR_); + } + + @Override + public List findEhrs(int start, int count) { + return ehrExporter.findEhrs(start, count); + } + + @Override + public Map>> findCompositions( + Collection ehrIds, EhrSchema tenant) { + return compositionExporter.findCompositions(ehrIds, tenant); + } + + @Override + public Map>> findStatus(Collection ehrIds, EhrSchema tenant) { + return ehrStatusExporter.findStatus(ehrIds, tenant); + } + + @Override + public Map>> findFolder(Collection uuids, EhrSchema tenant) { + return folderExporter.findFolders(uuids, tenant); + } + + @Override + public Map> findContributions(Collection ehrIds) { + return contributionExporter.findContributions(ehrIds); + } + + @Override + public EhrSchemaData findEhrSchemaData() { + return ehrSchemaDataExporter.getEhrSchemaData(); + } + + @Override + public void postProcess(ExtendedEhr ehr) { + // we need to add the contribution version by reverse mapping + Map idToContribution = + ehr.getContributions().stream().collect(Collectors.toMap(Contribution::getUid, Function.identity())); + Function, Contribution> contributionByVersion = v -> { + ObjectId contributionId = v.getContribution().getId(); + if (contributionId instanceof HierObjectId hid) { + Contribution contribution = idToContribution.get(hid); + if (contribution == null) { + throw new IllegalArgumentException("Missing composition %s".formatted(hid)); + } else { + return contribution; + } + } else { + throw new IllegalArgumentException("Unexpected contribution id type: %s".formatted(contributionId)); + } + }; + + Optional.ofNullable(ehr.getCompositions()).orElse(List.of()).stream() + .map(VersionedObjectData::originalVersions) + .flatMap(Collection::stream) + .forEach(v -> ContributionExporter.addVersionRef(contributionByVersion.apply(v), v, "COMPOSITION")); + + ehr.getEhrStatus() + .originalVersions() + .forEach(v -> ContributionExporter.addVersionRef(contributionByVersion.apply(v), v, "EHR_STATUS")); + + Optional.ofNullable(ehr.getFolders()).orElse(List.of()).stream() + .map(VersionedObjectData::originalVersions) + .flatMap(Collection::stream) + .forEach(v -> ContributionExporter.addVersionRef(contributionByVersion.apply(v), v, "FOLDER")); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/FolderExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/FolderExporter.java new file mode 100644 index 0000000..53d4933 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/FolderExporter.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.AuditDetails.AUDIT_DETAILS; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolder.EHR_FOLDER; +import static org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolderHistory.EHR_FOLDER_HISTORY; + +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectRef; +import com.nedap.archie.rm.support.identification.ObjectVersionId; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrFolderHistoryRecord; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.CanonicalJson; +import org.jooq.DSLContext; +import org.jooq.impl.DSL; + +class FolderExporter { + + private static final int EHR_DIRECTORY_FOLDER_IDX = 1; + + private final DSLContext dslContext; + private final EhrSchemaDataExporter ehrSchemaDataExporter; + + private final PartyExporter partyExporter; + + public FolderExporter(DSLContext dslContext) { + this.dslContext = dslContext; + ehrSchemaDataExporter = new EhrSchemaDataExporter(dslContext); + this.partyExporter = new PartyExporter(dslContext); + } + + protected Map>> findFolders(Collection ehrIds, EhrSchema tenant) { + + var result = dslContext + .select(EHR_FOLDER.fields()) + .select( + DSL.field("null").as(EHR_FOLDER_HISTORY.SYS_PERIOD_UPPER.getName()), + DSL.field("false").as(EHR_FOLDER_HISTORY.SYS_DELETED.getName())) + .select(AUDIT_DETAILS.fields()) + .from(EHR_FOLDER) + .join(AUDIT_DETAILS) + .on(EHR_FOLDER.AUDIT_ID.eq(AUDIT_DETAILS.ID)) + .where(EHR_FOLDER.EHR_ID.in(ehrIds).and(EHR_FOLDER.EHR_FOLDERS_IDX.eq(EHR_DIRECTORY_FOLDER_IDX))) + .unionAll(dslContext + .select(EHR_FOLDER_HISTORY.fields(ArrayUtils.addAll( + EHR_FOLDER.fields(), + EHR_FOLDER_HISTORY.SYS_PERIOD_UPPER, + EHR_FOLDER_HISTORY.SYS_DELETED))) + .select(AUDIT_DETAILS.fields()) + .from(EHR_FOLDER_HISTORY) + .join(AUDIT_DETAILS) + .on(EHR_FOLDER_HISTORY.AUDIT_ID.eq(AUDIT_DETAILS.ID)) + .where(EHR_FOLDER_HISTORY + .EHR_ID + .in(ehrIds) + .and(EHR_FOLDER_HISTORY.EHR_FOLDERS_IDX.eq(EHR_DIRECTORY_FOLDER_IDX)))) + .stream() + .map(r -> Pair.of( + new ArrayList<>(List.of(r.into(EhrFolderHistoryRecord.class))), + r.into(AuditDetailsRecord.class))) + // Folder is stored in multiple rows we need to reduce here + .collect(Collectors.groupingBy( + p -> { + var f = p.getLeft().getFirst(); + return Triple.of(f.getEhrId(), f.getEhrFoldersIdx(), f.getSysVersion()); + }, + Collectors.reducing((p1, p2) -> { + p1.getLeft().addAll(p2.getLeft()); + return p1; + }))); + + Map>> collect = result.values().stream() + .map(Optional::orElseThrow) + .map(p -> to(p.getLeft(), p.getRight(), tenant)) + .collect(CompositionExporter.groupingVersionedObjectsByEhrIdCollector()); + + // we fetch and add parties as batch + partyExporter.addParty(collect); + return collect; + } + + private Pair> to( + List ehrFolderRecords, AuditDetailsRecord auditDetailsRecord, EhrSchema tenant) { + + OriginalVersion originalVersion = new OriginalVersion<>(); + EhrFolderHistoryRecord root = ehrFolderRecords.stream() + .filter(r -> r.getRowNum().equals(0)) + .findFirst() + .orElseThrow(); + + originalVersion.setUid(new ObjectVersionId( + root.getId() + "::" + ehrSchemaDataExporter.getSystemId(tenant) + "::" + root.getSysVersion())); + originalVersion.setCommitAudit(AuditExporter.to(auditDetailsRecord)); + + // fix a bug where folder was audit was always set to creation + if (BooleanUtils.isTrue(root.getSysDeleted()) + && originalVersion + .getCommitAudit() + .getChangeType() + .getDefiningCode() + .getCodeString() + .equals("" + AuditExporter.ContributionChangeType.CREATION.code)) { + originalVersion + .getCommitAudit() + .setChangeType(AuditExporter.convert(AuditExporter.ContributionChangeType.DELETED)); + } + // fix a bug where folder was audit was always set to creation + if (root.getSysVersion() > 1 + && originalVersion + .getCommitAudit() + .getChangeType() + .getDefiningCode() + .getCodeString() + .equals("" + AuditExporter.ContributionChangeType.CREATION.code)) { + originalVersion + .getCommitAudit() + .setChangeType(AuditExporter.convert(AuditExporter.ContributionChangeType.MODIFICATION)); + } + + if (!originalVersion + .getCommitAudit() + .getChangeType() + .getDefiningCode() + .getCodeString() + .equals("" + AuditExporter.ContributionChangeType.DELETED.code)) { + originalVersion.setData(from(ehrFolderRecords)); + } + originalVersion.setContribution( + new ObjectRef<>(new HierObjectId(root.getContributionId().toString()), "local", "CONTRIBUTION")); + + return Pair.of(root.getEhrId(), originalVersion); + } + + private static Folder from(List ehrFolderRecords) { + + Map, EhrFolderHistoryRecord> byPathMap = ehrFolderRecords.stream() + .collect(Collectors.toMap( + ehrFolderRecord -> + Arrays.stream(ehrFolderRecord.getPath()).toList(), + Function.identity())); + + return from( + byPathMap.keySet().stream().filter(l -> l.size() == 1).findAny().orElseThrow(), byPathMap); + } + + private static Folder from(List path, Map, EhrFolderHistoryRecord> byPathMap) { + + Folder folder = + new CanonicalJson().unmarshal(byPathMap.get(path).getFields().data(), Folder.class); + + byPathMap.keySet().stream().filter(l -> l.size() == path.size() + 1).forEach(nextPath -> { + Folder subFolder = from( + nextPath, + byPathMap.entrySet().stream() + .filter(e -> e.getKey().size() >= nextPath.size() + && e.getKey().subList(0, nextPath.size()).equals(nextPath)) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))); + + folder.addFolder(subFolder); + }); + + return folder; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/PartyExporter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/PartyExporter.java new file mode 100644 index 0000000..0e35730 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/PartyExporter.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0; + +import static org.ehrbase.migration.MigrationUtils.getPartyProxyUuid; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.IDENTIFIER; +import static org.ehrbase.migration.exporter.v0.jooq.pg.Tables.PARTY_IDENTIFIED; + +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.datavalues.DvIdentifier; +import com.nedap.archie.rm.ehr.EhrStatus; +import com.nedap.archie.rm.generic.PartyIdentified; +import com.nedap.archie.rm.generic.PartyProxy; +import com.nedap.archie.rm.generic.PartyRelated; +import com.nedap.archie.rm.generic.PartySelf; +import com.nedap.archie.rm.support.identification.GenericId; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.ObjectId; +import com.nedap.archie.rm.support.identification.ObjectVersionId; +import com.nedap.archie.rm.support.identification.PartyRef; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.function.Consumer; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.IdentifierRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyIdentifiedRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.DSLContext; + +class PartyExporter { + + private final DSLContext dslContext; + + public PartyExporter(DSLContext dslContext) { + this.dslContext = dslContext; + } + + protected Map findParties(Collection ids) { + + return dslContext + .select(PARTY_IDENTIFIED.fields()) + .select(IDENTIFIER.fields()) + .from(PARTY_IDENTIFIED) + .leftJoin(IDENTIFIER) + .on(IDENTIFIER.PARTY.eq(PARTY_IDENTIFIED.ID)) + .where(PARTY_IDENTIFIED.ID.in(ids)) + .fetchGroups(r -> r.into(PartyIdentifiedRecord.class), r -> r.into(IdentifierRecord.class)) + .entrySet() + .stream() + .map(e -> to(e.getKey(), e.getValue())) + .collect(Collectors.toMap(Pair::getKey, Pair::getValue)); + } + + private static Pair to(PartyIdentifiedRecord record, List identifiers) { + + PartyProxy partyProxy = buildPartyProxy(record); + + if (partyProxy instanceof com.nedap.archie.rm.generic.PartyIdentified partyIdentified) { + partyIdentified.setIdentifiers(identifiers.stream() + .filter(r -> r.getIdValue() != null) + .map(PartyExporter::to) + .toList()); + ((com.nedap.archie.rm.generic.PartyIdentified) partyProxy).setName(record.getName()); + } + if (partyProxy instanceof PartyRelated partyRelated) { + + DvCodedTextRecord relationship = record.getRelationship(); + + partyRelated.setRelationship((DvCodedText) EhrSchemaDataExporter.to(relationship)); + } + + return Pair.of(record.getId(), partyProxy); + } + + protected static PartyProxy buildPartyProxy(PartyIdentifiedRecord record) { + PartyProxy partyProxy = + switch (record.getPartyType()) { + case party_identified -> new com.nedap.archie.rm.generic.PartyIdentified(); + case party_self -> new PartySelf(); + case party_related -> new PartyRelated(); + }; + + ObjectId objectId = + switch (record.getObjectIdType()) { + case generic_id -> new GenericId(record.getPartyRefValue(), record.getPartyRefScheme()); + case hier_object_id -> new HierObjectId(record.getPartyRefValue()); + case object_version_id -> new ObjectVersionId(record.getPartyRefValue()); + default -> null; + }; + + if (objectId != null) { + partyProxy.setExternalRef(new PartyRef(objectId, record.getPartyRefNamespace(), record.getPartyRefType())); + } + return partyProxy; + } + + private static DvIdentifier to(IdentifierRecord record) { + + DvIdentifier identifier = new DvIdentifier(); + identifier.setIssuer(record.getIssuer()); + identifier.setAssigner(record.getAssigner()); + identifier.setId(record.getIdValue()); + identifier.setType(record.getTypeName()); + return identifier; + } + + protected void addParty(Map>> collect) { + + Map>> byParty = Stream.concat( + collect.values().stream() + .flatMap(Collection::stream) + .map(VersionedObjectData::originalVersions) + .flatMap(Set::stream) + .flatMap(v1 -> getStream(v1.getData())), + collect.values().stream() + .flatMap(Collection::stream) + .map(VersionedObjectData::originalVersions) + .flatMap(Set::stream) + .map(v -> { + Consumer consumer = v.getCommitAudit()::setCommitter; + return Pair.of( + getPartyProxyUuid(v.getCommitAudit().getCommitter()), consumer); + })) + .collect(Collectors.groupingBy(Pair::getKey, Collectors.mapping(Pair::getValue, Collectors.toList()))); + + findParties(byParty.keySet()).forEach((k, v) -> byParty.get(k).forEach(c -> c.accept(v))); + } + + private static Stream>> getStream(T data) { + List, Consumer>> list = new ArrayList<>(); + if (data instanceof Composition composition) { + + list.add(Pair.of(composition::getComposer, composition::setComposer)); + if (composition.getContext() != null) { + list.add(Pair.of(composition.getContext()::getHealthCareFacility, healthCareFacility -> composition + .getContext() + .setHealthCareFacility((PartyIdentified) healthCareFacility))); + composition + .getContext() + .getParticipations() + .forEach(p -> list.add(Pair.of(p::getPerformer, p::setPerformer))); + } + + } else if (data instanceof EhrStatus status) { + + list.add(Pair.of(status::getSubject, subject -> status.setSubject((PartySelf) subject))); + } + + return list.stream() + .filter(p -> p.getLeft().get() != null) + .map(p -> Pair.of(getPartyProxyUuid(p.getLeft().get()), p.getRight())); + } + + protected static PartyIdentified buildDummy(UUID composer) { + if (composer == null) { + return null; + } + return new PartyIdentified(new PartyRef(new HierObjectId(composer.toString()), null, null), null, null); + } + + protected static PartySelf buildDummySelf(UUID composer) { + if (composer == null) { + return null; + } + return new PartySelf(new PartyRef(new HierObjectId(composer.toString()), null, null)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/OtherDetailsJsonbBinder.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/OtherDetailsJsonbBinder.java new file mode 100644 index 0000000..137b835 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/OtherDetailsJsonbBinder.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2019-2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.binding; + +import com.nedap.archie.rm.datastructures.ItemStructure; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Types; +import java.util.Objects; +import java.util.Optional; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RawJson; +import org.jooq.Binding; +import org.jooq.BindingGetResultSetContext; +import org.jooq.BindingGetSQLInputContext; +import org.jooq.BindingGetStatementContext; +import org.jooq.BindingRegisterContext; +import org.jooq.BindingSQLContext; +import org.jooq.BindingSetSQLOutputContext; +import org.jooq.BindingSetStatementContext; +import org.jooq.Converter; +import org.jooq.JSONB; +import org.jooq.conf.ParamType; +import org.jooq.impl.DSL; + +/** + * Binding = Object (unknown DB type), and = {@link ItemStructure} (user type) for "other_details" column (of STATUS table). + * See pom.xml of this module for further configuration, like what columns are linked with this binding. + * https://www.jooq.org/doc/3.12/manual/code-generation/custom-data-type-bindings/ + */ +public class OtherDetailsJsonbBinder implements Binding { + + // The converter does all the work + @Override + public Converter converter() { + return new Converter<>() { + + @Override + public ItemStructure from(org.jooq.JSONB databaseObject) { + // null is valid "other_details" column's value + return Optional.ofNullable(databaseObject) + .map(JSONB::data) + .map(i -> new RawJson().unmarshal(i, ItemStructure.class)) + .orElse(null); + } + + @Override + public JSONB to(ItemStructure userObject) { + return Optional.ofNullable(userObject) + .map(i -> JSONB.valueOf(new RawJson().marshal(i))) + .orElse(null); + } + + @Override + public Class fromType() { + return org.jooq.JSONB.class; + } + + @Override + public Class toType() { + return ItemStructure.class; + } + }; + } + + // Methods below are mapping the converter from above to specific scenarios, i.e. calling via different jooq and + // jooq-compatible sql executions. For instance, .store() or manually building a InsertQuery. + + /** + * Rending a bind variable for the binding context's value and casting it to the ItemStructure type + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. + if (ctx.render().paramType() == ParamType.INLINED) + ctx.render().visit(DSL.inline(ctx.convert(converter()).value())).sql("::jsonb"); + else ctx.render().sql("?::jsonb"); + } + + /** + * Registering VARCHAR types for JDBC CallableStatement OUT parameters + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void register(BindingRegisterContext ctx) throws SQLException { + ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR); + } + + /** + * Converting the ItemStructure to a String value and setting that on a JDBC PreparedStatement + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void set(BindingSetStatementContext ctx) throws SQLException { + ctx.statement() + .setString( + ctx.index(), Objects.toString(ctx.convert(converter()).value(), null)); + } + + /** + * Getting a String value from a JDBC ResultSet and converting that to a ItemStructure + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void get(BindingGetResultSetContext ctx) throws SQLException { + ctx.convert(converter()).value(JSONB.jsonbOrNull(ctx.resultSet().getString(ctx.index()))); + } + + /** + * Getting a String value from a JDBC CallableStatement and converting that to a ItemStructure + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void get(BindingGetStatementContext ctx) throws SQLException { + ctx.convert(converter()).value(JSONB.jsonbOrNull(ctx.statement().getString(ctx.index()))); + } + + /** + * Getting a value from a JDBC SQLInput (useful for Oracle OBJECT types) + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void get(BindingGetSQLInputContext ctx) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + /** + * Setting a value on a JDBC SQLOutput (useful for Oracle OBJECT types) + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void set(BindingSetSQLOutputContext ctx) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/SysPeriodBinder.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/SysPeriodBinder.java new file mode 100644 index 0000000..7c14d0f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/binding/SysPeriodBinder.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2020-2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.binding; + +import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME; + +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Types; +import java.time.OffsetDateTime; +import java.util.AbstractMap; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.jooq.Binding; +import org.jooq.BindingGetResultSetContext; +import org.jooq.BindingGetSQLInputContext; +import org.jooq.BindingGetStatementContext; +import org.jooq.BindingRegisterContext; +import org.jooq.BindingSQLContext; +import org.jooq.BindingSetSQLOutputContext; +import org.jooq.BindingSetStatementContext; +import org.jooq.Converter; +import org.jooq.conf.ParamType; +import org.jooq.impl.DSL; + +/** + * Binding = Object (unknown DB type), and = {@link AbstractMap.SimpleEntry} (user type) for "sys_period" column (of STATUS table). + * See pom.xml of this module for further configuration, like what columns are linked with this binding. + * Source: https://www.jooq.org/doc/3.12/manual/code-generation/custom-data-type-bindings/ + */ +@SuppressWarnings("serial") +public class SysPeriodBinder implements Binding> { + + // source of pattern: https://gist.github.com/gregopet/8d0feb4fe4075a8525c1175243ee38b0 + private static final String DATE_OR_EMPTY = "(?:(?:\"([^\"]+)\")?)"; + private static final Pattern PATTERN = Pattern.compile("[(\\[(]" + DATE_OR_EMPTY + "," + DATE_OR_EMPTY + "[\\])]"); + + // The converter does all the work + @Override + public Converter> converter() { + return new Converter<>() { + + @SuppressWarnings("unchecked") + @Override + public AbstractMap.SimpleEntry from(Object databaseObject) { + if (databaseObject == null) { + return null; + } else if (databaseObject instanceof AbstractMap.SimpleEntry) + return (AbstractMap.SimpleEntry) databaseObject; + else { + Matcher m = PATTERN.matcher("" + databaseObject); + if (m.find()) { + String lowerStr = m.group(1).replace(" ", "T"); + String upperStr = m.group(2); + + OffsetDateTime lower = OffsetDateTime.parse(lowerStr); + + if (upperStr != null) { // can be empty + upperStr = upperStr.replace(" ", "T"); + OffsetDateTime upper = OffsetDateTime.parse(upperStr); + return new AbstractMap.SimpleEntry<>(lower, upper); + } else { + return new AbstractMap.SimpleEntry<>(lower, null); + } + } else { + throw new IllegalArgumentException("Unsupported range : " + databaseObject); + } + } + } + + @Override + public Object to(AbstractMap.SimpleEntry userObject) { + if (userObject == null) { + return null; + } + + String lower = userObject.getKey().format(ISO_OFFSET_DATE_TIME).replace("T", " "); + String upper = ""; + if (userObject.getValue() != null) // upper bound can be empty + upper = userObject.getValue().format(ISO_OFFSET_DATE_TIME).replace("T", " "); + + if (upper.isEmpty()) { + return "[\"" + lower + "\",)"; + } else { + return "[\"" + lower + "\",)\"" + lower + "\")"; + } + } + + @Override + public Class fromType() { + return Object.class; + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public Class> toType() { + return (Class) AbstractMap.SimpleEntry.class; + } + }; + } + + // Methods below are mapping the converter from above to specific scenarios, i.e. calling via different jooq and + // jooq-compatible sql executions. For instance, .store() or manually building a InsertQuery. + + /** + * Rending a bind variable for the binding context's value and casting it to the AbstractMap.SimpleEntry type + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void sql(BindingSQLContext> ctx) + throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. + if (ctx.render().paramType() == ParamType.INLINED) + ctx.render().visit(DSL.inline(ctx.convert(converter()).value())).sql("::tstzrange"); + else ctx.render().sql("?::tstzrange"); + } + + /** + * Registering VARCHAR types for JDBC CallableStatement OUT parameters + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void register(BindingRegisterContext> ctx) + throws SQLException { + ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR); + } + + /** + * Converting the AbstractMap.SimpleEntry to a String value and setting that on a JDBC PreparedStatement + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void set(BindingSetStatementContext> ctx) + throws SQLException { + ctx.statement() + .setString( + ctx.index(), Objects.toString(ctx.convert(converter()).value(), null)); + } + + /** + * Getting a String value from a JDBC ResultSet and converting that to a AbstractMap.SimpleEntry + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void get(BindingGetResultSetContext> ctx) + throws SQLException { + ctx.convert(converter()).value(ctx.resultSet().getString(ctx.index())); + } + + /** + * Getting a String value from a JDBC CallableStatement and converting that to a AbstractMap.SimpleEntry + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void get(BindingGetStatementContext> ctx) + throws SQLException { + ctx.convert(converter()).value(ctx.statement().getString(ctx.index())); + } + + /** + * Getting a value from a JDBC SQLInput (useful for Oracle OBJECT types) + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void get(BindingGetSQLInputContext> ctx) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + /** + * Setting a value on a JDBC SQLOutput (useful for Oracle OBJECT types) + * + * @param ctx internal DB context + * @throws SQLException when SQL execution failed + */ + @Override + public void set(BindingSetSQLOutputContext> ctx) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositeClassName.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositeClassName.java new file mode 100644 index 0000000..38a8752 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositeClassName.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.datavalues.DataValue; +import com.nedap.archie.rm.datavalues.quantity.DvInterval; + +public class CompositeClassName { + + private DataValue dataValue; + + public CompositeClassName(DataValue dataValue) { + this.dataValue = dataValue; + } + + /** + * extrapolate composite class name such as DvInterval + * + * @return + */ + public String toString() { + String classname = new SimpleClassName(dataValue).toString(); + + if ("DvInterval".equals(classname) + && !(((DvInterval) dataValue).getLower() == null + && ((DvInterval) dataValue).getUpper() == null)) { // get the classname of lower/upper + DvInterval interval = (DvInterval) dataValue; + String lowerClassName = null; + String upperClassName = null; + + // either lower or upper or both are set value + if (interval.getLower() != null) lowerClassName = new SimpleClassName(interval.getLower()).toString(); + + if (interval.getUpper() != null) upperClassName = new SimpleClassName(interval.getUpper()).toString(); + + if (lowerClassName != null && upperClassName != null && (!lowerClassName.equals(upperClassName))) + throw new IllegalArgumentException( + "Lower and Upper classnames do not match:" + lowerClassName + " vs." + upperClassName); + + return classname + "<" + (lowerClassName != null ? lowerClassName : upperClassName) + ">"; + } + return classname; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositionSerializer.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositionSerializer.java new file mode 100644 index 0000000..90a3d95 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/CompositionSerializer.java @@ -0,0 +1,765 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.nedap.archie.rm.RMObject; +import com.nedap.archie.rm.composition.Action; +import com.nedap.archie.rm.composition.Activity; +import com.nedap.archie.rm.composition.AdminEntry; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.composition.ContentItem; +import com.nedap.archie.rm.composition.Evaluation; +import com.nedap.archie.rm.composition.Instruction; +import com.nedap.archie.rm.composition.Observation; +import com.nedap.archie.rm.composition.Section; +import com.nedap.archie.rm.datastructures.Cluster; +import com.nedap.archie.rm.datastructures.Element; +import com.nedap.archie.rm.datastructures.Event; +import com.nedap.archie.rm.datastructures.History; +import com.nedap.archie.rm.datastructures.Item; +import com.nedap.archie.rm.datastructures.ItemList; +import com.nedap.archie.rm.datastructures.ItemSingle; +import com.nedap.archie.rm.datastructures.ItemStructure; +import com.nedap.archie.rm.datastructures.ItemTable; +import com.nedap.archie.rm.datastructures.ItemTree; +import com.nedap.archie.rm.datavalues.DvText; +import com.nedap.archie.rm.integration.GenericEntry; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.collections.map.MultiValueMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.ActionAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.ActivityAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.AdminEntryAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.ClusterAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.ElementAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.EvaluationAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.EventAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.HistoryAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.InstructionAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.ItemStructureAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.ObservationAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.SectionAttributes; +import org.ehrbase.openehr.sdk.serialisation.exception.MarshalException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Sequential Event Processor for Composition. + * + *

Takes an RM composition and serialize it as a Maps of Maps and Arrays with WrappedElements. + * since some duplicate entries have been noticed, the node id contains type:name:archetype_id + */ +public class CompositionSerializer { + + public enum WalkerOutputMode { + PATH, + NAMED, + EXPANDED, + RAW + } + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + protected ItemStack itemStack = new ItemStack(); + + private final WalkerOutputMode tagMode; // default + + public static final String TAG_META = "/meta"; + public static final String TAG_CONTENT = "/content"; + public static final String TAG_PROTOCOL = "/protocol"; + public static final String TAG_DATA = "/data"; + public static final String TAG_STATE = "/state"; + public static final String TAG_DESCRIPTION = "/description"; + public static final String TAG_TIME = "/time"; + public static final String TAG_WIDTH = "/width"; + public static final String TAG_MATH_FUNCTION = "/math_function"; + public static final String TAG_INSTRUCTION = "/instruction"; + public static final String TAG_NARRATIVE = "/narrative"; + public static final String TAG_EXPIRY_TIME = "/expiry_time"; + public static final String TAG_ITEMS = "/items"; + public static final String TAG_OTHER_CONTEXT = "/context/other_context"; + public static final String TAG_ACTIVITIES = "/activities"; + public static final String TAG_ACTIVITY = "/activity"; + public static final String TAG_VALUE = "/value"; + public static final String TAG_NULL_FLAVOUR = "/null_flavour"; + public static final String TAG_FEEDER_AUDIT = "/feeder_audit"; + public static final String TAG_EVENTS = "/events"; + public static final String TAG_ORIGIN = "/origin"; + public static final String TAG_SUMMARY = "/summary"; + public static final String TAG_TIMING = "/timing"; + public static final String TAG_COMPOSITION = "/composition"; + public static final String TAG_ENTRY = "/entry"; + public static final String TAG_EVALUATION = "/evaluation"; + public static final String TAG_OBSERVATION = "/observation"; + public static final String TAG_ACTION = "/action"; + public static final String TAG_SUBJECT = "/subject"; + public static final String TAG_LANGUAGE = "/language"; + public static final String TAG_ENCODING = "/encoding"; + public static final String TAG_ISM_TRANSITION = "/ism_transition"; + public static final String TAG_CURRENT_STATE = "/current_state"; + public static final String TAG_CAREFLOW_STEP = "/careflow_step"; + public static final String TAG_ISM_TRANSITION_REASON = "/careflow_step"; + public static final String TAG_TRANSITION = "/transition"; + public static final String TAG_WORKFLOW_ID = "/workflow_id"; + public static final String TAG_WF_DEFINITION = "/wf_definition"; + public static final String TAG_GUIDELINE_ID = "/guideline_id"; + public static final String TAG_OTHER_PARTICIPATIONS = "/other_participations"; + public static final String TAG_PROVIDER = "/provider"; // care entry provider + public static final String TAG_UID = "/uid"; + public static final String TAG_OTHER_DETAILS = "/other_details"; + public static final String TAG_INSTRUCTION_DETAILS = "/instruction_details"; + public static final String TAG_ACTIVITY_ID = "/action_id"; + public static final String TAG_INSTRUCTION_ID = "/instruction_id"; + public static final String TAG_PATH = "/$PATH$"; + public static final String TAG_CLASS = "/$CLASS$"; + public static final String TAG_NAME = "/name"; + public static final String TAG_DEFINING_CODE = "/defining_code"; + public static final String INNER_CLASS_LIST = "$INNER_CLASS_LIST$"; + public static final String TAG_ACTION_ARCHETYPE_ID = "/action_archetype_id"; + public static final String TAG_ARCHETYPE_NODE_ID = "/archetype_node_id"; + public static final String TAG_LINKS = "/links"; + public static final String DEFAULT_NARRATIVE = "DEFAULT_NARRATIVE"; + public static final String TAG_ARCHETYPE_DETAILS = "/archetype_details"; + public static final String EPOCH_OFFSET = "epoch_offset"; + public static final DvText NO_NAME = null; + + public CompositionSerializer() { + this.tagMode = WalkerOutputMode.PATH; + } + + /** + * main entry method, process a composition. + * + * @param composition + * @return + */ + // @Override + private Map traverse(Composition composition) { + Map ctree = PathMap.getInstance(); + if (composition == null /* CHC 170426: no content is legit... */) { + return null; + } + + Map ltree = MultiMap.getInstance(); + + if (composition.getContent() != null && !composition.getContent().isEmpty()) { + for (ContentItem item : composition.getContent()) { + ltree = new EntrySerialTree(ltree, tagMode).insert(item, TAG_CONTENT, traverse(item, TAG_CONTENT)); + } + } + + ltree.remove(TAG_CLASS); + ltree.put(TAG_CLASS, new SimpleClassName(composition).toString()); // force the classname + itemStack.popStacks(); + + ctree = new EntrySerialTree(ctree, tagMode).insert(composition, TAG_COMPOSITION, ltree); + + return ctree; + } + + /** + * domain level: Observation, evaluation, instruction, action. section, admin etc. + * + * @param item + * @param tag + * @throws Exception + */ + private Map traverse(ContentItem item, String tag) { + + Map retmap = null; + + if (item == null) { + return null; + } + + log.debug( + "traverse element of class: {}, tag: {}, nodeid: {}", item.getClass(), tag, item.getArchetypeNodeId()); + + if (item.getArchetypeNodeId() == null || item.getArchetypeNodeId().isEmpty()) { + throw new IllegalArgumentException( + "ContentItem mandatory attribute archetype_node_id null or empty, item:" + item); + } + + if (item.getName() == null || item.getName().getValue().isEmpty()) { + throw new IllegalArgumentException( + "ContentItem mandatory attribute name is null or empty, item:" + item.getArchetypeNodeId()); + } + + itemStack.pushStacks( + tag + "[" + item.getArchetypeNodeId() + "]", item.getName().getValue()); + + if (item instanceof Observation) { + Observation observation = (Observation) item; + Map ltree = PathMap.getInstance(); + + if (observation.getProtocol() != null) { + Object protocol = traverse(observation.getProtocol(), TAG_PROTOCOL); + if (protocol != null) { + ltree = new EntrySerialTree(ltree, tagMode).insert(observation, TAG_PROTOCOL, protocol); + } + } + + if (observation.getData() != null) { + ltree = new EntrySerialTree(ltree, tagMode) + .insert(observation, TAG_DATA, traverse(observation.getData(), TAG_DATA)); + } + + if (observation.getState() != null) { + ltree = new EntrySerialTree(ltree, tagMode) + .insert(observation, TAG_STATE, traverse(observation.getState(), TAG_STATE)); + } + + ltree = new ObservationAttributes(this, itemStack, ltree).toMap(observation); + + if (ltree.size() > 0) { + retmap = ltree; + } + + } else if (item instanceof Evaluation) { + Evaluation evaluation = (Evaluation) item; + Map ltree = PathMap.getInstance(); + + if (evaluation.getProtocol() != null) { + Object protocol = traverse(evaluation.getProtocol(), TAG_PROTOCOL); + if (protocol != null) { + ltree = new EntrySerialTree(ltree, tagMode).insert(evaluation, TAG_PROTOCOL, protocol); + } + } + + if (evaluation.getData() != null) { + ltree = new EntrySerialTree(ltree, tagMode) + .insert(evaluation, TAG_DATA, traverse(evaluation.getData(), TAG_DATA)); + } + + ltree = new EvaluationAttributes(this, itemStack, ltree).toMap(evaluation); + + if (ltree.size() > 0) { + retmap = ltree; + } + + } else if (item instanceof Instruction) { + Map ltree = PathMap.getInstance(); + + Instruction instruction = (Instruction) item; + + if (instruction.getProtocol() != null) { + Object protocol = traverse(instruction.getProtocol(), TAG_PROTOCOL); + if (protocol != null) { + ltree = new SerialTree(ltree) + .insert( + instruction, + new NodeEncoding(tagMode) + .tag(TAG_PROTOCOL, ((Instruction) item).getProtocol(), ltree), + protocol); + } + } + + ltree = new InstructionAttributes(this, itemStack, ltree).toMap(instruction); + + if (instruction.getActivities() != null) { + + Map activities = MultiMap.getInstance(); + for (Activity activity : instruction.getActivities()) { + itemStack.pushStacks( + TAG_ACTIVITIES + "[" + activity.getArchetypeNodeId() + "]", + activity.getName().getValue()); + activities = new EntrySerialTree(activities, tagMode) + .insert(activity, TAG_ACTIVITIES, traverse(activity, TAG_DESCRIPTION)); + itemStack.popStacks(); + } + + ltree = new EntrySerialTree(ltree, tagMode).insert(instruction, TAG_ACTIVITIES, activities); + } + + if (ltree.size() > 0) { + retmap = ltree; + } + + } else if (item instanceof Action) { + Map ltree = PathMap.getInstance(); + + Action action = (Action) item; + + if (action.getProtocol() != null) { + Object protocol = traverse(action.getProtocol(), TAG_PROTOCOL); + if (protocol != null) { + ltree = new EntrySerialTree(ltree, tagMode).insert(action, TAG_PROTOCOL, protocol); + } + } + + if (action.getDescription() != null) { + Object description = traverse(action.getDescription(), TAG_DESCRIPTION); + if (description != null) { + ltree = new EntrySerialTree(ltree, tagMode).insert(action, TAG_DESCRIPTION, description); + } + } else { + // this should not occur except in test scenario as this is rejected by the validation + if (log.isWarnEnabled()) { + log.warn("ACTION requires attribute 'description' at node: {}", itemStack.pathStackDump()); + } + } + + ltree = new ActionAttributes(this, itemStack, ltree).toMap(action); + ltree.computeIfAbsent(TAG_CLASS, value -> new SimpleClassName(item).toString()); + + retmap = ltree; + + } else if (item instanceof Section) { + + Map ltree = MultiMap.getInstance(); + + for (ContentItem contentItem : ((Section) item).getItems()) { + ltree = new SerialTree(ltree) + .insert( + contentItem, + new NodeEncoding(tagMode).tag(TAG_ITEMS, contentItem, ltree), + traverse(contentItem, TAG_ITEMS)); + log.debug("ltree now: {}", ltree != null); + } + + ltree = new SectionAttributes(this, itemStack, ltree).toMap((Section) item); + + ltree.remove(TAG_CLASS); + ltree.put(TAG_CLASS, new SimpleClassName(item).toString()); // force the classname + ltree = fixLocatableAttributes(ltree); + retmap = ltree; + + } else if (item instanceof AdminEntry) { + AdminEntry adminEntry = (AdminEntry) item; + Map ltree = PathMap.getInstance(); + + if (adminEntry.getData() != null) { + ltree = new SerialTree(ltree) + .insert( + adminEntry, + new NodeEncoding(tagMode).tag(TAG_DATA, adminEntry.getData(), ltree), + traverse(adminEntry.getData(), TAG_DATA)); + } + + ltree = new AdminEntryAttributes(this, itemStack, ltree).toMap(adminEntry); + + if (ltree.size() > 0) { + retmap = ltree; + } + + } else if (item instanceof GenericEntry) { + Map ltree = PathMap.getInstance(); + + GenericEntry genericEntry = (GenericEntry) item; + + ltree = new SerialTree(ltree) + .insert( + genericEntry, + new NodeEncoding(tagMode).tag(TAG_DATA, genericEntry.getData(), ltree), + traverse(genericEntry.getData(), TAG_DATA)); + + if (ltree.size() > 0) { + retmap = ltree; + } + + } else { + log.warn("This item is not handled! {}", item.getNameAsString()); + } + + itemStack.popStacks(); + return retmap; + } + + private Map traverse(Activity activity, String tag) { + if (activity == null) { + return null; + } + + log.debug("traverse activity: {}", activity); + + if (activity.getDescription() == null) { + throw new IllegalArgumentException("Invalid activity, no description found:" + activity.getNameAsString()); + } + + Map ltree = PathMap.getInstance(); + + ltree = new ActivityAttributes(this, itemStack, ltree).toMap(activity); + + itemStack.pushStacks( + tag + "[" + activity.getDescription().getArchetypeNodeId() + "]", + activity.getDescription().getName().getValue()); + + if (log.isDebugEnabled()) { + log.debug( + "{}{}[{}]={}", + itemStack.pathStackDump(), + TAG_DESCRIPTION, + activity.getArchetypeNodeId(), + activity.getDescription()); + } + + ltree = new EntrySerialTree(ltree, tagMode) + .insert( + activity, + TAG_DESCRIPTION, + traverse( + activity.getDescription(), + null)); // don't add a /data in path for description (don't ask me why...) + + itemStack.popStacks(); + return ltree; + } + + /** + * History level in composition + * + * @param history + * @param tag + * @throws Exception + */ + private Map traverse(History history, String tag) { + if (history == null) { + return null; + } + + log.debug("traverse history: {}", history); + + itemStack.pushStacks( + tag + "[" + history.getArchetypeNodeId() + "]", + history.getName().getValue()); + + Map ltree = PathMap.getInstance(); + + if (log.isDebugEnabled()) { + log.debug( + "{}{}[{}]={}", + itemStack.pathStackDump(), + TAG_ORIGIN, + history.getArchetypeNodeId(), + history.getOrigin()); + } + + ltree = new HistoryAttributes(this, itemStack, ltree).toMap(history); + + if (history.getSummary() != null) { + ltree = new EntrySerialTree(ltree, tagMode) + .insert(history, TAG_SUMMARY, traverse(history.getSummary(), TAG_SUMMARY)); + } + + if (history.getEvents() != null) { + + Map eventtree = MultiMap.getInstance(); + + for (Event event : history.getEvents()) { + itemStack.pushStacks( + TAG_EVENTS + "[" + event.getArchetypeNodeId() + "]", + event.getName().getValue()); + + Map subtree = PathMap.getInstance(); + + if (log.isDebugEnabled()) { + log.debug( + "{}{}[{}]={}", + itemStack.pathStackDump(), + TAG_TIME, + event.getArchetypeNodeId(), + event.getTime()); + } + + subtree = new EventAttributes(this, itemStack, subtree).toMap(event); + + if (event.getData() != null) { + subtree = new EntrySerialTree(subtree, tagMode) + .insert(event, TAG_DATA, traverse(event.getData(), TAG_DATA)); + } + if (event.getState() != null) { + subtree = new EntrySerialTree(subtree, tagMode) + .insert(event, TAG_STATE, traverse(event.getState(), TAG_STATE)); + } + + if (!subtree.containsKey(TAG_CLASS)) { + log.warn("Inserting class type, potentially a test case?"); + subtree.put(TAG_CLASS, new SimpleClassName(event).toString()); + } + + itemStack.popStacks(); + + eventtree = new SerialTree(eventtree) + .insert(null, event, new NodeEncoding(tagMode).tag(TAG_EVENTS, event, eventtree), subtree); + } + + ltree = new EntrySerialTree(ltree, tagMode).insert(history, TAG_EVENTS, eventtree); + } + + itemStack.popStacks(); + return ltree; + } + + /** + * identify if the entry is a value singleton. If so, compact the entry to be "KEY/Value=entry" if + * not, use the usual convention of hash of hash... + * + * @param target + * @throws Exception + */ + private Map compactEntry( + Object node, Map target, String key, Map entry) { + // if entry is null, ignore, the dirty bit is not set... + if (entry != null && !entry.isEmpty()) { + if (entry.keySet().size() == 1 && entry.get(TAG_VALUE) != null) { + Object o = entry.get(TAG_VALUE); + // TAG_VALUE is not required in the properties map representation + target = new SerialTree(target).insert(null, null, key, o); + } else { + target = new SerialTree(target) + .insert(new SimpleClassName(node).toString(), null, key, entry); // unchanged and uncompacted + } + } + + return target; + } + + /** + * ItemStructure: single, tree or table + * + * @param item + * @param uppertag + */ + private Map traverse(ItemStructure item, String uppertag) { + + Map retmap = null; + + log.debug("traverse itemstructure: {}", item); + + if (item == null) { + return null; + } + + if (uppertag != null) { + itemStack.pushStacks(uppertag + "[" + item.getArchetypeNodeId() + "]", item.getNameAsString()); + } + + if (item instanceof ItemSingle) { + Map ltree = PathMap.getInstance(); + + ItemSingle itemSingle = (ItemSingle) item; + + if (itemSingle.getItem() != null) { + ltree = compactEntry( + itemSingle, + ltree, + new NodeEncoding(tagMode).tag(TAG_ITEMS, itemSingle, ltree), + traverse(itemSingle.getItem(), TAG_ITEMS)); + } + if (ltree.size() > 0) { + retmap = ltree; + } + } else if (item instanceof ItemList) { + Map ltree = MultiMap.getInstance(); + + ItemList list = (ItemList) item; + + if (list.getItems() != null) { + + for (Item listItem : list.getItems()) { + ltree = compactEntry( + listItem, + ltree, + new NodeEncoding(tagMode).tag(TAG_ITEMS, listItem, ltree), + traverse(listItem, TAG_ITEMS)); + } + } + if (ltree.size() > 0) { + retmap = ltree; + } + + } else if (item instanceof ItemTree) { + Map ltree = MultiMap.getInstance(); + + ItemTree tree = (ItemTree) item; + + if (tree.getItems() != null) { + + for (Item subItem : tree.getItems()) { + ltree = compactEntry( + subItem, + ltree, + new NodeEncoding(tagMode).tag(TAG_ITEMS, subItem, ltree), + traverse(subItem, TAG_ITEMS)); + } + } + if (ltree.size() > 0) { + retmap = ltree; + } + + } else if (item instanceof ItemTable) { + Map ltree = MultiMap.getInstance(); + + ItemTable table = (ItemTable) item; + + if (table.getRows() != null) { + + for (Item subItem : table.getRows()) { + ltree = compactEntry( + subItem, + ltree, + new NodeEncoding(tagMode).tag(TAG_ITEMS, subItem, ltree), + traverse(subItem, TAG_ITEMS)); + } + } + if (ltree.size() > 0) { + retmap = ltree; + } + } + + if (uppertag != null) { + itemStack.popStacks(); + } + + if (retmap != null) { + if (retmap.containsKey(TAG_CLASS)) { + retmap.remove(CompositionSerializer.TAG_CLASS); // this will come out as an array... + } + retmap.put(TAG_CLASS, new SimpleClassName(item).toString()); // this will come out as an array... + retmap = new ItemStructureAttributes(this, itemStack, retmap).toMap(item); + retmap = fixLocatableAttributes(retmap); + } + return retmap; + } + + private Map fixLocatableAttributes(Map map) { + if (map instanceof MultiValueMap) { + Map newMap = new LinkedHashMap<>(); + + map.forEach((k, v) -> { + if (List.of(TAG_UID, TAG_FEEDER_AUDIT, TAG_LINKS).contains(k) + && v instanceof List + && !((List) v).isEmpty()) { + newMap.put(k, ((List) v).get(0)); + } else { + newMap.put(k, v); + } + }); + + return newMap; + } else { + return map; + } + } + + /** + * Element level, normally cannot go deeper... + * + * @param item + * @param tag + * @throws Exception + */ + private Map traverse(Item item, String tag) { + Map retmap = PathMap.getInstance(); + + log.debug("traverse item: {}", item); + + if (item == null) { + return null; + } + + if (item instanceof Element) { // NB. Element value and null flavour are optional + itemStack.pushStacks(tag + "[" + item.getArchetypeNodeId() + "]", null); + retmap = new ElementAttributes(this, itemStack, retmap).toMap((Element) item); + itemStack.popStacks(); + } else if (item instanceof Cluster) { + Map ltree = MultiMap.getInstance(); + itemStack.pushStacks(tag + "[" + item.getArchetypeNodeId() + "]", item.getNameAsString()); + + Cluster cluster = (Cluster) item; + boolean hasContent = false; + + if (cluster.getItems() != null) { + + // CHC:160914: fixed issue with cluster encoding as items (generated /value {/name... + // /value... /$PATH$... $CLASS$}) + // this caused inconsistencies when running AQL queries + for (Item clusterItem : cluster.getItems()) { + Map clusterItems = traverse(clusterItem, TAG_ITEMS); + + if (clusterItems != null) { + clusterItems.computeIfPresent( + TAG_CLASS, (key, value) -> item.getClass().getSimpleName()); + ltree.put( + new NodeEncoding(tagMode).tag(TAG_ITEMS, clusterItem, ltree), + clusterItems.getOrDefault(TAG_VALUE, clusterItems)); + // + } + } + if (ltree.size() > 0) { + hasContent = true; + } + + ltree = new ClusterAttributes(this, itemStack, ltree).toMap(cluster); + + ltree.computeIfAbsent(TAG_CLASS, value -> Cluster.class.getSimpleName()); + } + if (hasContent) { + ltree = fixLocatableAttributes(ltree); + retmap = ltree; + } else { + retmap = null; + } + + itemStack.popStacks(); + } + + return retmap; + } + + // @Override + public String dbEncode(RMObject rmObject) { + + Map objectMap; + if (rmObject instanceof Composition) { + objectMap = traverse((Composition) rmObject); + } else if (rmObject instanceof Item) { + objectMap = traverse((Item) rmObject, TAG_ITEMS); + } else if (rmObject instanceof ItemStructure) { + objectMap = traverse((ItemStructure) rmObject, TAG_ITEMS); + if (objectMap != null + && !objectMap.containsKey(TAG_ARCHETYPE_NODE_ID) + && ((ItemStructure) rmObject).getArchetypeNodeId() != null) { + objectMap.put( + CompositionSerializer.TAG_ARCHETYPE_NODE_ID, ((ItemStructure) rmObject).getArchetypeNodeId()); + } + if (objectMap != null + && !objectMap.containsKey(CompositionSerializer.TAG_NAME) + && ((ItemStructure) rmObject).getName() != null) { + objectMap.put(CompositionSerializer.TAG_NAME, ((ItemStructure) rmObject).getName()); + } + } else { + throw new MarshalException(String.format("Class %s not supported ", rmObject.getClass()), null); + } + + GsonBuilder builder = EncodeUtilArchie.getGsonBuilderInstance(); + Gson gson = builder.setPrettyPrinting().create(); + return gson.toJson(objectMap); + } + + public Map getLtreeMap() { + return itemStack.getLtreeMap(); + } + + public WalkerOutputMode tagMode() { + return tagMode; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ElementValue.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ElementValue.java new file mode 100644 index 0000000..ef972af --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ElementValue.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.base.Interval; +import com.nedap.archie.rm.datavalues.DataValue; +import com.nedap.archie.rm.datavalues.quantity.DvInterval; + +/** + * this class handles special DataValues for DB serialization + */ +public class ElementValue { + DataValue value; + + public ElementValue(DataValue value) { + this.value = value; + } + + /** + * a normalize value is either a DATA_VALUE or rm.base type (at the moment Interval) + * this is required to normalize AQL path accesses to the data attributes + * + * @return the actualized object following the DB encoding convention + */ + public Object normalize() { + if (value instanceof DvInterval) { + DvInterval dvInterval = (DvInterval) value; + Interval interval = new Interval<>(dvInterval.getLower(), dvInterval.getUpper()); + interval.setLowerIncluded(dvInterval.isLowerIncluded()); + interval.setUpperIncluded(dvInterval.isUpperIncluded()); + interval.setLowerUnbounded(dvInterval.isLowerUnbounded()); + interval.setUpperUnbounded(dvInterval.isUpperUnbounded()); + return interval; + } + return value; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/Elements.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/Elements.java new file mode 100644 index 0000000..0ad531c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/Elements.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.datastructures.Element; + +/** + * utility to deal with Element content check + */ +public class Elements { + + private Element element; + + public Elements(Element element) { + this.element = element; + } + + /** + * check if an element is containing any significant values to be serialized (e.g. stored) to DB + * + * @return + */ + public boolean isVoid() { + return (element.getValue() == null && element.getNullFlavour() == null); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EncodeUtilArchie.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EncodeUtilArchie.java new file mode 100644 index 0000000..1f03711 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EncodeUtilArchie.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.google.gson.GsonBuilder; +import com.google.gson.internal.LinkedTreeMap; +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.datavalues.DvText; +import com.nedap.archie.rm.datavalues.TermMapping; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import com.nedap.archie.rm.generic.Participation; +import com.nedap.archie.rm.generic.PartyIdentified; +import com.nedap.archie.rm.support.identification.PartyRef; +import java.util.ArrayList; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter.AdapterType; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.CodePhraseAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.DvCodedTextAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.DvDateAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.DvDateTimeAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.DvDurationAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.DvTextAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.DvTimeAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.ParticipationAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.PartyIdentifiedAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.PartyRefAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.TermMappingAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw.ArrayListAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw.LinkedTreeMapAdapter; + +/** Created by christian on 9/9/2016. */ +public class EncodeUtilArchie { + + private EncodeUtilArchie() { + throw new IllegalStateException("Use static calls instead"); + } + + /** + * utility to make sure writer adapter are set consistently + * + * @return GsonBuilder + */ + public static GsonBuilder getGsonBuilderInstance() { + return new GsonBuilder() + .registerTypeAdapter(DvDateTime.class, new DvDateTimeAdapter()) + .registerTypeAdapter(DvDate.class, new DvDateAdapter()) + .registerTypeAdapter(DvTime.class, new DvTimeAdapter()) + .registerTypeAdapter(DvDuration.class, new DvDurationAdapter()) + .registerTypeAdapter(DvText.class, new DvTextAdapter()) + .registerTypeAdapter(DvCodedText.class, new DvCodedTextAdapter()) + .registerTypeAdapter(CodePhrase.class, new CodePhraseAdapter()) + .registerTypeAdapter(Participation.class, new ParticipationAdapter()) + .registerTypeAdapter(PartyIdentified.class, new PartyIdentifiedAdapter()) + .registerTypeAdapter(PartyRef.class, new PartyRefAdapter()) + .registerTypeAdapter(TermMapping.class, new TermMappingAdapter(AdapterType.PG_JSONB)); + } + + public static GsonBuilder getGsonBuilderInstance(AdapterType dbjson2rawjson) { + switch (dbjson2rawjson) { + case DBJSON2RAWJSON: + GsonBuilder builder = new GsonBuilder() + .registerTypeAdapter(LinkedTreeMap.class, new LinkedTreeMapAdapter()) + .registerTypeAdapter(ArrayList.class, new ArrayListAdapter()); + return builder; + default: + throw new IllegalStateException("Invalid/unsupported json converter:" + dbjson2rawjson); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EntrySerialTree.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EntrySerialTree.java new file mode 100644 index 0000000..e5268c8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/EntrySerialTree.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.composition.*; +import com.nedap.archie.rm.datastructures.Event; +import com.nedap.archie.rm.datastructures.History; +import java.util.Map; + +/** Used to insert Entry specific attributes in the encoded map. */ +public class EntrySerialTree extends SerialTree { + + private final CompositionSerializer.WalkerOutputMode tagMode; + + public EntrySerialTree(Map map, CompositionSerializer.WalkerOutputMode tagMode) { + super(map); + this.tagMode = tagMode; + } + + public Map insert(Composition composition, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_COMPOSITION: + retMap = super.insert( + composition, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_COMPOSITION, composition, map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(ContentItem contentItem, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_CONTENT: + if (addStructure != null && !((Map) addStructure).containsKey(CompositionSerializer.TAG_NAME)) + ((Map) addStructure) + .put( + CompositionSerializer.TAG_NAME, + new NameAsDvText(contentItem.getName()) + .toMap()); // this fixes the issue with SECTION name + retMap = super.insert( + contentItem, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_CONTENT, contentItem, map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(Observation observation, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_PROTOCOL: + retMap = super.insert( + observation, + new NodeEncoding(tagMode) + .tag(CompositionSerializer.TAG_PROTOCOL, observation.getProtocol(), map), + addStructure); + break; + case CompositionSerializer.TAG_DATA: + retMap = super.insert( + observation, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_DATA, observation.getData(), map), + addStructure); + break; + case CompositionSerializer.TAG_STATE: + retMap = super.insert( + observation, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_STATE, observation.getState(), map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(Evaluation evaluation, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_PROTOCOL: + retMap = super.insert( + evaluation, + new NodeEncoding(tagMode) + .tag(CompositionSerializer.TAG_PROTOCOL, evaluation.getProtocol(), map), + addStructure); + break; + case CompositionSerializer.TAG_DATA: + retMap = super.insert( + evaluation, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_DATA, evaluation.getData(), map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(Instruction instruction, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_PROTOCOL: + retMap = super.insert( + instruction, + new NodeEncoding(tagMode) + .tag(CompositionSerializer.TAG_PROTOCOL, instruction.getProtocol(), map), + addStructure); + break; + case CompositionSerializer.TAG_ACTIVITIES: + retMap = super.insert(instruction, CompositionSerializer.TAG_ACTIVITIES, addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(Activity activity, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_ACTIVITIES: + retMap = super.insert( + activity, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_ACTIVITIES, activity, map), + addStructure); + break; + case CompositionSerializer.TAG_DESCRIPTION: + retMap = super.insert( + activity, + new NodeEncoding(tagMode) + .tag(CompositionSerializer.TAG_DESCRIPTION, activity.getDescription(), map), + addStructure); + break; + + default: + retMap = map; + } + + return retMap; + } + + public Map insert(Action action, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_PROTOCOL: + retMap = super.insert( + action, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_PROTOCOL, action.getProtocol(), map), + addStructure); + break; + case CompositionSerializer.TAG_DESCRIPTION: + retMap = super.insert( + action, + new NodeEncoding(tagMode) + .tag(CompositionSerializer.TAG_DESCRIPTION, action.getDescription(), map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(History history, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_SUMMARY: + retMap = super.insert( + history, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_SUMMARY, history, map), + addStructure); + break; + case CompositionSerializer.TAG_EVENTS: + retMap = super.insert( + history, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_EVENTS, null, map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } + + public Map insert(Event event, String attribute, Object addStructure) { + Map retMap; + switch (attribute) { + case CompositionSerializer.TAG_DATA: + retMap = super.insert( + event, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_DATA, event.getData(), map), + addStructure); + break; + case CompositionSerializer.TAG_STATE: + retMap = super.insert( + event, + new NodeEncoding(tagMode).tag(CompositionSerializer.TAG_STATE, event.getState(), map), + addStructure); + break; + default: + retMap = map; + } + + return retMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ItemStack.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ItemStack.java new file mode 100644 index 0000000..8c8c221 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/ItemStack.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import java.util.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** ETHERCIS Project ehrservice Created by Christian Chevalley on 8/3/2015. */ +public class ItemStack { + + private static final String archetypePrefix = "[openEHR-"; + private static final String namedItemPrefix = " and name/value='"; + private static final String namedItemSuffix = "']"; + + private Logger log = LoggerFactory.getLogger(this.getClass()); + + // contains the ADL path to an element + private Deque pathStack = new ArrayDeque<>(); + // contains the named path to an element (used to bind Flat JSON) + private Deque namedStack = new ArrayDeque<>(); + + // used to resolve and index containments + private class ContainmentStruct { + private String label; + private String fullPath; // full path + + ContainmentStruct(String archetype, String path) { + this.label = archetype; + this.fullPath = path; + } + + public String getLabel() { + return label; + } + + String getFullPath() { + return fullPath; + } + } + + private Stack containmentStack = new Stack<>(); + + private Map ltreeMap = new TreeMap<>(); + + public Map getLtreeMap() { + return ltreeMap; + } + + // replace all dots by underscore and keep only the archetype name part + public static String normalizeLabel(String path) { + String label = path.substring(path.indexOf("[") + 1); + int namedIndex = label.indexOf(namedItemPrefix); + if (namedIndex >= 0) label = label.substring(0, namedIndex); + + // replace all dots by underscores since it is used as delimiter in a dotted labels expression + // for ltree + // only A-Za-z0-9_ are allowed to express a label + label = label.replace("\\.", "_").replace("-", "_"); + if (label.endsWith("]")) label = label.substring(0, label.indexOf("]")); + return label; + } + + public static String getLabelType(String path) { + if (path.contains("[")) return path.substring(1, path.indexOf("[")); + return path; + } + + private boolean isArchetypeSlot(String path) { + return path.contains(archetypePrefix); + } + + private void flushContainmentMap() { + // get the last element on stack + ContainmentStruct containmentStruct = containmentStack.lastElement(); + if (!ltreeMap.containsKey(containmentStruct.getLabel())) + ltreeMap.put(containmentStruct.getLabel(), containmentStruct.getFullPath()); + } + + public void pushStacks(String path, String name) { + // specify name/value for path in the format /something[openEHR-EHR-blablah...] for + // disambiguation + log.debug("-- PUSH PATH:" + path + "::" + name); + if ((path.contains(archetypePrefix) + || path.contains(CompositionSerializer.TAG_ACTIVITIES) + || path.contains(CompositionSerializer.TAG_ITEMS) + || path.contains(CompositionSerializer.TAG_EVENTS)) + && name != null) { + // add name in path + path = path.substring(0, path.indexOf("]")) + namedItemPrefix + name + namedItemSuffix; + } + pushStack(pathStack, path); + if (name != null) pushStack(namedStack, name.toLowerCase().replace(" ", "_")); + if (isArchetypeSlot(path)) { + + String label = normalizeLabel(path); + // get the previous label if any + String previousLabel = null; + + if (!containmentStack.isEmpty()) { + previousLabel = containmentStack.lastElement().getLabel(); + } + if (previousLabel != null) { + label = previousLabel + "." + label; + } + ContainmentStruct containmentStruct = new ContainmentStruct(label, pathStackDump()); + containmentStack.push(containmentStruct); + } + } + + public void popStacks() { + log.debug("-- POP PATH:" + (pathStack.isEmpty() ? "*empty*" : pathStack.getLast())); + String path = popStack(pathStack); + if (path != null && isArchetypeSlot(path)) { + flushContainmentMap(); + containmentStack.pop(); + } + popStack(namedStack); + } + + private void pushStack(Deque stack, String s) { + stack.push(s); + } + + private String popStack(Deque stack) { + if (!stack.isEmpty()) { + return stack.pop(); + } + return null; + } + + private String stackDump(Deque stack) { + StringBuilder b = new StringBuilder(); + for (Object s : stack.toArray()) b.append((String) s); + return b.toString(); + } + + public String namedStackDump() { + StringBuilder b = new StringBuilder(); + for (Object s : namedStack.toArray()) b.append(s).append("/"); + return b.toString(); + } + + public String expandedStackDump() { + StringBuilder b = new StringBuilder(); + int i = 0; + String[] pathArray = pathStack.toArray(new String[] {}); + for (Object s : namedStack.toArray()) { + b.append(s).append("{{").append(pathArray[i++]).append("}}/"); + } + return b.toString(); + } + + public String pathStackDump() { + return stackDump(pathStack); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/MultiMap.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/MultiMap.java new file mode 100644 index 0000000..f7ea326 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/MultiMap.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import java.util.Map; +import org.apache.commons.collections.map.MultiValueMap; + +/** + * trivial wrapper for multivaluemap + */ +public class MultiMap { + + private MultiMap() { + throw new IllegalStateException("Use only static method in this class"); + } + + public static Map getInstance() { + return new MultiValueMap(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameAsDvText.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameAsDvText.java new file mode 100644 index 0000000..adcc726 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameAsDvText.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.datavalues.DvCodedText; +import com.nedap.archie.rm.datavalues.DvText; +import java.util.HashMap; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.SnakeCase; + +/** + * format a RM object name as a DvText or DvCodedText + */ +public class NameAsDvText { + + private DvText aName; + + public NameAsDvText(DvText aName) { + this.aName = aName; + } + + public Map toMap() { + Map nameMap = new HashMap<>(); + if (aName instanceof DvCodedText) { + nameMap.put("defining_code", ((DvCodedText) (aName)).getDefiningCode()); + } + if (aName != null) { + nameMap.put("value", aName.getValue()); + if (aName.getMappings() != null) { + nameMap.put("mappings", aName.getMappings()); + } + } + nameMap.put(I_DvTypeAdapter.AT_TYPE, new SnakeCase(DvText.class.getSimpleName()).camelToUpperSnake()); + return nameMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameInMap.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameInMap.java new file mode 100644 index 0000000..2e1bc97 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NameInMap.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * encode a RM object name in an array of name values + */ +public class NameInMap { + + private Map map; + private Map nameValues; + + public NameInMap(Map map, Map nameValues) { + this.map = map; + this.nameValues = nameValues; + } + + public Map toMap() { + List> nameListMap = new ArrayList<>(); + nameListMap.add(nameValues); + map.put(CompositionSerializer.TAG_NAME, nameListMap); + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NodeEncoding.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NodeEncoding.java new file mode 100644 index 0000000..068489b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/NodeEncoding.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.archetyped.Locatable; +import org.apache.commons.collections.map.MultiValueMap; + +public class NodeEncoding { + + private final CompositionSerializer.WalkerOutputMode tagMode; + + public NodeEncoding(CompositionSerializer.WalkerOutputMode tagMode) { + this.tagMode = tagMode; + } + + public String tag(String prefix, Locatable node, Object container) { + switch (tagMode) { + case PATH: + if (node == null) return prefix; + else { + String path = prefix + "[" + node.getArchetypeNodeId() + "]"; + if (!container.getClass().equals(MultiValueMap.class) + && !(path.startsWith(CompositionSerializer.TAG_DESCRIPTION)) + && !(path.startsWith(CompositionSerializer.TAG_COMPOSITION)) + && (path.contains("[openEHR-") + || path.contains(CompositionSerializer.TAG_ACTIVITIES) + || path.contains(CompositionSerializer.TAG_ITEMS) + || path.contains(CompositionSerializer.TAG_EVENTS))) { + + // expand name in key + String name = node.getName().getValue(); + + if (name != null) { + path = path.substring(0, path.lastIndexOf("]")) + " and name/value='" + name + "']"; + } + } + + return path; + } + + case NAMED: + case EXPANDED: + case RAW: + if (prefix.equals(CompositionSerializer.TAG_ORIGIN) + || prefix.equals(CompositionSerializer.TAG_TIME) + || prefix.equals(CompositionSerializer.TAG_TIMING) + || (prefix.equals(CompositionSerializer.TAG_EVENTS) && node == null)) + return "[" + prefix.substring(1) + "]"; + else if (node == null) + return "!!!INVALID NAMED for " + prefix + " !!!"; // comes from encodeNodeAttribute... + else { + /* ISSUE, the name can be a translation hence any query in the JSON structure will be impossible! + F.e. String name = node.nodeName(); + */ + return node.getArchetypeNodeId(); + } + + default: + return "*INVALID MODE*"; + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathItem.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathItem.java new file mode 100644 index 0000000..a056132 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathItem.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.WalkerOutputMode; + +/** encode the PATH attribute of an Element for the DB */ +public class PathItem { + + private Map map; + private final CompositionSerializer.WalkerOutputMode tagMode; + private final ItemStack itemStack; + + public PathItem(Map map, WalkerOutputMode tagMode, ItemStack itemStack) { + this.map = map; + this.tagMode = tagMode; + this.itemStack = itemStack; + } + + public Map encode(String tag) { + Map retMap = map; + + switch (tagMode) { + case PATH: + retMap = new SerialTree(map) + .insert( + null, + (Object) null, + CompositionSerializer.TAG_PATH, + tag == null ? itemStack.pathStackDump() : itemStack.pathStackDump() + tag); + break; + case NAMED: + retMap = new SerialTree(map) + .insert( + null, + (Object) null, + CompositionSerializer.TAG_PATH, + tag == null + ? itemStack.namedStackDump() + : itemStack.namedStackDump() + tag.substring(1)); + break; + case EXPANDED: + retMap = new SerialTree(map) + .insert( + null, + (Object) null, + CompositionSerializer.TAG_PATH, + tag == null + ? itemStack.expandedStackDump() + : itemStack.expandedStackDump() + tag.substring(1)); + break; + case RAW: + break; + default: + throw new IllegalArgumentException("Invalid tagging mode!"); + } + + return retMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathMap.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathMap.java new file mode 100644 index 0000000..a994988 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/PathMap.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import java.util.Map; +import java.util.TreeMap; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.collections4.PredicateUtils; + +public class PathMap { + + public PathMap() { + throw new IllegalStateException("Use only static method in this class"); + } + /** + * to remain consistent regarding datastructure, we use a map which prevents duplicated keys... and throw + * an exception if one is detected... + * + * @return + */ + @SuppressWarnings("unchecked") + public static Map getInstance() { + return MapUtils.predicatedMap(new TreeMap<>(), PredicateUtils.uniquePredicate(), null); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RawJson.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RawJson.java new file mode 100644 index 0000000..809163d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RawJson.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.RMObject; +import com.nedap.archie.rm.composition.Composition; +import java.io.IOException; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.rawjson.LightRawJsonEncoder; +import org.ehrbase.openehr.sdk.serialisation.RMDataFormat; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.ArchieObjectMapperProvider; + +public class RawJson implements RMDataFormat { + + private Map ltreeMap; + + @Override + public String marshal(RMObject rmObject) { + try { + CompositionSerializer compositionSerializer = new CompositionSerializer(); + String encode = compositionSerializer.dbEncode(rmObject); + ltreeMap = compositionSerializer.getLtreeMap(); + return encode; + } catch (Exception e) { + throw new IllegalArgumentException(e.getMessage(), e); + } + } + + @Override + public T unmarshal(String value, Class clazz) { + + String converted; + if (clazz.equals(Composition.class)) { + converted = new LightRawJsonEncoder(value).encodeCompositionAsString(); + } else { + converted = new LightRawJsonEncoder(value).encodeContentAsString(null); + } + try { + return ArchieObjectMapperProvider.getObjectMapper().readValue(converted, clazz); + } catch (IOException e) { + throw new IllegalArgumentException(e.getMessage(), e); + } + } + + public Map getLtreeMap() { + return ltreeMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RmObjectEncoding.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RmObjectEncoding.java new file mode 100644 index 0000000..6b0ab1b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/RmObjectEncoding.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import com.nedap.archie.rm.RMObject; +import java.util.Map; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.CanonicalJson; + +public class RmObjectEncoding { + + private final RMObject rmObject; + + public RmObjectEncoding(RMObject rmObject) { + this.rmObject = rmObject; + } + + public Map toMap() { + return new CanonicalJson().unmarshalToMap(new CanonicalJson().marshal(rmObject)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SerialTree.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SerialTree.java new file mode 100644 index 0000000..c3942e2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SerialTree.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_NAME; +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_PATH; + +import com.nedap.archie.rm.RMObject; +import com.nedap.archie.rm.archetyped.Locatable; +import java.util.Map; +import org.apache.commons.collections4.map.PredicatedMap; +import org.ehrbase.openehr.sdk.util.rmconstants.RmConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * insert the attributes of a structural object into the DB encoded structure + */ +public class SerialTree { + + Map map; + + Logger log = LoggerFactory.getLogger(this.getClass().getSimpleName()); + + public SerialTree(Map map) { + this.map = map; + } + + /** + * put a key=value pair in a map and detects duplicates. + * + * @param key + * @param addStructure + * @return + * @throws Exception + */ + public Map insert(String clazz, Object node, String key, Object addStructure) { + if (addStructure == null) { + return map; + } + + if (addStructure instanceof Map + && ((Map) addStructure).size() == 0 + && !clazz.equalsIgnoreCase(RmConstants.COMPOSITION)) { + return map; + } + + if (key.equals(TAG_NAME)) { + if (addStructure instanceof Map) { + return new NameInMap(map, (Map) addStructure).toMap(); + } else { + throw new IllegalStateException( + "INTERNAL: addStructure is not a map, found:" + addStructure.getClass()); + } + } + + try { + if (addStructure instanceof RMObject) { + map.put(key, new RmObjectEncoding((RMObject) addStructure).toMap()); + } else { + map.put(key, addStructure); + } + // add explicit name + if (node instanceof Locatable && map instanceof PredicatedMap && !map.containsKey(TAG_NAME)) { + new NameInMap(map, new NameAsDvText(((Locatable) node).getName()).toMap()).toMap(); + } + + } catch (IllegalArgumentException e) { + log.error("Ignoring duplicate key in path detected: {}", key, e); + } + + if (clazz != null && !key.equals(TAG_PATH) && !map.containsKey(TAG_CLASS)) { + map.put(CompositionSerializer.TAG_CLASS, clazz); + } else { + log.debug(map.containsKey(TAG_CLASS) ? "duplicate TAG_CLASS" : "null clazz"); + } + + return map; + } + + public Map insert(Object node, String key, Object addStructure) { + + String clazz = new SimpleClassName(node).toString(); + + return insert(clazz, node, key, addStructure); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SimpleClassName.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SimpleClassName.java new file mode 100644 index 0000000..2d89316 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/SimpleClassName.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding; + +/** + * simple wrapper to get the class name of an object + */ +public class SimpleClassName { + + Object object; + + public SimpleClassName(Object object) { + this.object = object; + } + + public String toString() { + return object.getClass().getSimpleName(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActionAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActionAttributes.java new file mode 100644 index 0000000..b66a89e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActionAttributes.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.composition.Action; +import com.nedap.archie.rm.composition.InstructionDetails; +import com.nedap.archie.rm.composition.IsmTransition; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; + +/** + * populate the attributes for RM Action + */ +public class ActionAttributes extends CareEntryAttributes { + + public ActionAttributes(CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Action action) { + + if (action.getTime() != null && !action.getTime().equals(new DvDateTime())) { + map = toMap(TAG_TIME, action.getTime(), action.getName()); + } + + if (action.getInstructionDetails() != null) { + InstructionDetails instructionDetails = action.getInstructionDetails(); + map.put(TAG_INSTRUCTION_DETAILS, new RmObjectEncoding(instructionDetails).toMap()); + } + + if (action.getIsmTransition() != null) { + IsmTransition ismTransition = action.getIsmTransition(); + if (ismTransition != null) { + map.put(TAG_ISM_TRANSITION, new RmObjectEncoding(ismTransition).toMap()); + } + } + + map = super.toMap(action); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActivityAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActivityAttributes.java new file mode 100644 index 0000000..a787aec --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ActivityAttributes.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_ACTION_ARCHETYPE_ID; +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_TIMING; + +import com.nedap.archie.rm.composition.Activity; +import com.nedap.archie.rm.datavalues.encapsulated.DvParsable; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Activity + */ +public class ActivityAttributes extends LocatableAttributes { + + public ActivityAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Activity activity) { + + if (activity.getTiming() != null && !activity.getTiming().equals(new DvParsable())) { + map = toMap(TAG_TIMING, activity.getTiming(), null); + } + + if (activity.getActionArchetypeId() != null) { + map.put(TAG_ACTION_ARCHETYPE_ID, activity.getActionArchetypeId()); + } + map = super.toMap(activity); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/AdminEntryAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/AdminEntryAttributes.java new file mode 100644 index 0000000..836a351 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/AdminEntryAttributes.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.composition.AdminEntry; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** populate the attributes for RM Observation */ +public class AdminEntryAttributes extends EntryAttributes { + + public AdminEntryAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(AdminEntry adminEntry) { + + map = super.toMap(adminEntry); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/CareEntryAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/CareEntryAttributes.java new file mode 100644 index 0000000..09e3e52 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/CareEntryAttributes.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_GUIDELINE_ID; + +import com.nedap.archie.rm.composition.CareEntry; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; + +/** populate the attributes for RM CareEntry */ +public abstract class CareEntryAttributes extends EntryAttributes { + + public CareEntryAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(CareEntry careEntry) { + + if (careEntry.getGuidelineId() != null) { + + map.put(TAG_GUIDELINE_ID, new RmObjectEncoding(careEntry.getGuidelineId()).toMap()); + } + + map = super.toMap(careEntry); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ClusterAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ClusterAttributes.java new file mode 100644 index 0000000..34d243e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ClusterAttributes.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.archetyped.Locatable; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Cluster + */ +public class ClusterAttributes extends ItemAttributes { + + public ClusterAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + @Override + public Map toMap(Locatable locatable) { + return super.toMap(locatable); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ContentItemAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ContentItemAttributes.java new file mode 100644 index 0000000..c7884b0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ContentItemAttributes.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM ContentItem + */ +public class ContentItemAttributes extends LocatableAttributes { + + public ContentItemAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/DataStructureAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/DataStructureAttributes.java new file mode 100644 index 0000000..41c48f8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/DataStructureAttributes.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM DataStructure + */ +public class DataStructureAttributes extends LocatableAttributes { + + public DataStructureAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ElementAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ElementAttributes.java new file mode 100644 index 0000000..84daabe --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ElementAttributes.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.datastructures.Element; +import com.nedap.archie.rm.datavalues.DvText; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositeClassName; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathItem; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SerialTree; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * populate the attributes for RM Elements + */ +public class ElementAttributes extends ItemAttributes { + + private static final String INITIAL_DUMMY_PREFIX = "$*>"; + + private boolean allElements = false; + private Logger log = LoggerFactory.getLogger(ElementAttributes.class.getSimpleName()); + + public ElementAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + /** + * map the value or null_flavour of an Element + * @param element + * @return + */ + public Map toMap(Element element) { + Map ltree = map; + + // to deal with ITEM_SINGLE initial value + if (element.getName().getValue().startsWith(INITIAL_DUMMY_PREFIX)) { + if (allElements) { // strip the prefix since it is for an example + DvText elementName = element.getName(); + elementName.setValue(elementName.getValue().substring(INITIAL_DUMMY_PREFIX.length())); + element.setName(elementName); + } else return ltree; + } + + // contains value or null_flavor + Map valuemap = buildValueMap(element); + ltree.put(TAG_VALUE, valuemap); + + return ltree; + } + + private Map buildValueMap(Element element) { + + Map valueMap = PathMap.getInstance(); + + if (element.getValue() != null && !element.getValue().toString().isEmpty()) { + log.debug(itemStack.pathStackDump() + "=" + element.getValue()); + + if (element.getValue() != null && !element.getValue().toString().isEmpty()) + valueMap = new SerialTree(valueMap) + .insert( + new CompositeClassName(element.getValue()).toString(), + element, + TAG_VALUE, + element.getValue()); + } else if (element.getNullFlavour() != null) { + valueMap = new SerialTree(valueMap).insert(null, element, TAG_NULL_FLAVOUR, element.getNullFlavour()); + } + if (element.getNullReason() != null) { + valueMap = new SerialTree(valueMap).insert(null, element, "/null_reason", element.getNullReason()); + } + + if (element.getFeederAudit() != null) { + valueMap = new SerialTree(valueMap).insert(null, element, TAG_FEEDER_AUDIT, element.getFeederAudit()); + } + if (element.getLinks() != null) { + valueMap = new SerialTree(valueMap).insert(null, element, TAG_LINKS, element.getLinks()); + } + + if (element.getUid() != null) { + valueMap = new SerialTree(valueMap).insert(null, element, TAG_UID, element.getUid()); + } + + // set path + valueMap = new PathItem(valueMap, tagMode, itemStack).encode(null); + + // set archetype_node_id + valueMap.put(TAG_ARCHETYPE_NODE_ID, element.getArchetypeNodeId()); + return valueMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EntryAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EntryAttributes.java new file mode 100644 index 0000000..19062f4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EntryAttributes.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.composition.Entry; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; + +/** + * populate the attributes for RM Entry + * https://specifications.openehr.org/releases/UML/latest/#Architecture___18_1_83e026d_1433773264997_829602_8426 + */ +public abstract class EntryAttributes extends LocatableAttributes { + + public EntryAttributes(CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + protected Map toMap(Entry entry) { + // add complementary attributes + + if (entry.getSubject() != null) { + map.put(TAG_SUBJECT, new SubjectAttributes(entry.getSubject(), compositionSerializer).toMap()); + } + if (entry.getLanguage() != null) { + map.put(TAG_LANGUAGE, new RmObjectEncoding(entry.getLanguage()).toMap()); + } + if (entry.getProvider() != null) { + map.put(TAG_PROVIDER, new SubjectAttributes(entry.getProvider(), compositionSerializer).toMap()); + } + if (entry.getEncoding() != null) { + map.put(TAG_ENCODING, new RmObjectEncoding(entry.getEncoding()).toMap()); + } + + if (entry.getWorkflowId() != null) { + + map.put(TAG_WORKFLOW_ID, new RmObjectEncoding(entry.getWorkflowId()).toMap()); + } + + if (entry.getOtherParticipations() != null + && !entry.getOtherParticipations().isEmpty()) { + map.put( + TAG_OTHER_PARTICIPATIONS, + new OtherParticipationAttributes(entry.getOtherParticipations(), compositionSerializer).toMap()); + } + + map = super.toMap(entry); + + return map; + } + + public static boolean isEntryAttribute(String key) { + return (key.equals(TAG_SUBJECT) + || key.equals(TAG_LANGUAGE) + || key.equals(TAG_PROVIDER) + || key.equals(TAG_ENCODING) + || key.equals(TAG_WORKFLOW_ID) + || key.equals(TAG_OTHER_PARTICIPATIONS)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EvaluationAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EvaluationAttributes.java new file mode 100644 index 0000000..02a3c5c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EvaluationAttributes.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.composition.Evaluation; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Evaluation + */ +public class EvaluationAttributes extends CareEntryAttributes { + + public EvaluationAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Evaluation evaluation) { + + map = super.toMap(evaluation); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EventAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EventAttributes.java new file mode 100644 index 0000000..4a8965e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/EventAttributes.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.datastructures.Event; +import com.nedap.archie.rm.datastructures.IntervalEvent; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Event, in particular timing information + */ +public class EventAttributes extends LocatableAttributes { + + public EventAttributes(CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Event event) { + + if (event instanceof IntervalEvent) { + IntervalEvent intervalEvent = (IntervalEvent) event; + if (intervalEvent.getWidth() != null) map.put(TAG_WIDTH, intervalEvent.getWidth()); + if (intervalEvent.getMathFunction() != null) map.put(TAG_MATH_FUNCTION, intervalEvent.getMathFunction()); + + if (intervalEvent.getSampleCount() != null) { + map.put("sample_count", intervalEvent.getSampleCount()); + } + } + + if (event.getTime() != null) { + map = toMap(TAG_TIME, event.getTime(), event.getName()); + } + + map = super.toMap(event); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditAttributes.java new file mode 100644 index 0000000..55e4577 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditAttributes.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; + +import com.nedap.archie.rm.archetyped.FeederAudit; +import com.nedap.archie.rm.datavalues.DvIdentifier; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SimpleClassName; + +/** + * populate the attributes for RM FeederAudit + */ +public class FeederAuditAttributes { + + private final FeederAudit feederAudit; + + public FeederAuditAttributes(FeederAudit feederAudit) { + this.feederAudit = feederAudit; + } + + /** + * encode the attributes lower snake case to comply with UML conventions and make is queryable + * @return + */ + public Map toMap() { + Map valuemap = PathMap.getInstance(); + + valuemap.put(TAG_CLASS, new SimpleClassName(feederAudit).toString()); + + if (feederAudit.getOriginatingSystemItemIds() != null + && !feederAudit.getOriginatingSystemItemIds().isEmpty()) { + valuemap.put("originating_system_item_ids", encodeDvIdentifiers(feederAudit.getOriginatingSystemItemIds())); + } + + valuemap.put( + "feeder_system_audit", new FeederAuditDetailsAttributes(feederAudit.getFeederSystemAudit()).toMap()); + + if (feederAudit.getFeederSystemItemIds() != null + && !feederAudit.getFeederSystemItemIds().isEmpty()) { + valuemap.put("feeder_system_item_ids", encodeDvIdentifiers(feederAudit.getFeederSystemItemIds())); + } + + if (feederAudit.getOriginalContent() != null) + valuemap.put("original_content", new RmObjectEncoding(feederAudit.getOriginalContent()).toMap()); + + valuemap.put( + "originating_system_audit", + new FeederAuditDetailsAttributes(feederAudit.getOriginatingSystemAudit()).toMap()); + + return valuemap; + } + + List> encodeDvIdentifiers(List dvIdentifiers) { + List> idList = new ArrayList<>(); + for (DvIdentifier dvIdentifier : dvIdentifiers) idList.add(new RmObjectEncoding(dvIdentifier).toMap()); + + return idList; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditDetailsAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditDetailsAttributes.java new file mode 100644 index 0000000..96cbf6f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/FeederAuditDetailsAttributes.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.archetyped.FeederAuditDetails; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.rawjson.LightRawJsonEncoder; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.SnakeCase; + +public class FeederAuditDetailsAttributes { + + private final FeederAuditDetails feederAuditDetails; + + public FeederAuditDetailsAttributes(FeederAuditDetails feederAuditDetails) { + this.feederAuditDetails = feederAuditDetails; + } + + /** + * encode the attributes lower snake case to comply with UML conventions and make is queryable + * @return + */ + public Map toMap() { + Map valuemap = PathMap.getInstance(); + + if (feederAuditDetails == null) return null; + + valuemap.put( + I_DvTypeAdapter.AT_TYPE, new SnakeCase(FeederAuditDetails.class.getSimpleName()).camelToUpperSnake()); + + if (feederAuditDetails.getLocation() != null) { + valuemap.put("location", new RmObjectEncoding(feederAuditDetails.getLocation()).toMap()); + } + if (feederAuditDetails.getProvider() != null) { + valuemap.put("provider", new RmObjectEncoding(feederAuditDetails.getProvider()).toMap()); + } + if (feederAuditDetails.getSubject() != null) { + valuemap.put("subject", new RmObjectEncoding(feederAuditDetails.getSubject()).toMap()); + } + if (feederAuditDetails.getSystemId() != null) { + valuemap.put("system_id", feederAuditDetails.getSystemId()); + } + if (feederAuditDetails.getTime() != null) { + valuemap.put("time", new RmObjectEncoding(feederAuditDetails.getTime()).toMap()); + } + if (feederAuditDetails.getVersionId() != null) { + valuemap.put("version_id", feederAuditDetails.getVersionId()); + } + if (feederAuditDetails.getOtherDetails() != null) { + String dbEncoded = new CompositionSerializer().dbEncode(feederAuditDetails.getOtherDetails()); + Map asMap = new LightRawJsonEncoder(dbEncoded).encodeOtherDetailsAsMap(); + String nodeId = asMap.get("/archetype_node_id").toString(); + // make sure node id is wrapped in [ and ] and throw errors if invalid input + if (!nodeId.startsWith("[")) { + if (nodeId.endsWith("]")) throw new IllegalArgumentException("Invalid archetype node id"); + nodeId = "[" + nodeId + "]"; + } else if (!nodeId.endsWith("]")) { + throw new IllegalArgumentException("Invalid archetype node id"); + } + valuemap.put("other_details" + nodeId, asMap); + } + return valuemap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/HistoryAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/HistoryAttributes.java new file mode 100644 index 0000000..79cfd11 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/HistoryAttributes.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_ORIGIN; + +import com.nedap.archie.rm.datastructures.History; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM History (origin in particular) + */ +public class HistoryAttributes extends DataStructureAttributes { + + public HistoryAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(History history) { + + if (history.getOrigin() != null && !history.getOrigin().equals(new DvDateTime())) { + map = toMap(TAG_ORIGIN, history.getOrigin(), history.getName()); + } + + map = super.toMap(history); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/I_SubjectAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/I_SubjectAttributes.java new file mode 100644 index 0000000..b4163b5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/I_SubjectAttributes.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import java.util.Map; + +public interface I_SubjectAttributes { + + Map toMap(); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionAttributes.java new file mode 100644 index 0000000..c4689d9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionAttributes.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.composition.Instruction; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; + +/** + * populate the attributes for RM Instruction (narrative) + */ +public class InstructionAttributes extends CareEntryAttributes { + + public InstructionAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Instruction instruction) { + + if (instruction.getNarrative() != null) { + map = toMap(TAG_NARRATIVE, instruction.getNarrative(), instruction.getName()); + } + + if (instruction.getExpiryTime() != null) { + map.put(TAG_EXPIRY_TIME, new RmObjectEncoding(instruction.getExpiryTime()).toMap()); + } + if (instruction.getWfDefinition() != null) { + map.put(TAG_WF_DEFINITION, new RmObjectEncoding(instruction.getWfDefinition()).toMap()); + } + + map = super.toMap(instruction); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionDetailsAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionDetailsAttributes.java new file mode 100644 index 0000000..c90c9d1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/InstructionDetailsAttributes.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.composition.InstructionDetails; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; + +public class InstructionDetailsAttributes { + + private final InstructionDetails instructionDetails; + + public InstructionDetailsAttributes(InstructionDetails instructionDetails) { + this.instructionDetails = instructionDetails; + } + + /** + * encode the attributes lower snake case to comply with UML conventions and make is queryable + * @return + */ + public Map toMap() { + Map valuemap = PathMap.getInstance(); + + if (instructionDetails == null) return null; + + if (instructionDetails.getActivityId() != null) { + valuemap.put("activity_id", instructionDetails.getActivityId()); + } + if (instructionDetails.getInstructionId() != null) { + valuemap.put("instruction_id", instructionDetails.getInstructionId()); + } + if (instructionDetails.getWfDetails() != null) { + valuemap.put("wf_details", instructionDetails.getWfDetails()); + } + return valuemap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/IsmTransitionAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/IsmTransitionAttributes.java new file mode 100644 index 0000000..3b3a578 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/IsmTransitionAttributes.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; + +import com.nedap.archie.rm.composition.IsmTransition; +import com.nedap.archie.rm.datavalues.DvText; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SimpleClassName; + +public class IsmTransitionAttributes { + + private final IsmTransition ismTransition; + + public IsmTransitionAttributes(IsmTransition ismTransition) { + this.ismTransition = ismTransition; + } + + /** + * encode the attributes lower snake case to comply with UML conventions and make is queryable + * @return + */ + public Map toMap() { + Map valuemap = PathMap.getInstance(); + + if (ismTransition == null) return null; + + if (ismTransition.getReason() != null) { + List> reasons = new ArrayList<>(); + for (DvText reason : ismTransition.getReason()) { + valuemap.put(TAG_CLASS, new SimpleClassName(reason).toString()); + valuemap.put("value", reason.getValue()); + reasons.add(valuemap); + } + valuemap.put("reason", reasons); + } + if (ismTransition.getCareflowStep() != null) { + valuemap.put("careflow_step", ismTransition.getCareflowStep()); + } + if (ismTransition.getCurrentState() != null) { + valuemap.put("current_state", ismTransition.getCurrentState()); + } + if (ismTransition.getTransition() != null) { + valuemap.put("transition", ismTransition.getTransition()); + } + return valuemap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemAttributes.java new file mode 100644 index 0000000..e88b76b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemAttributes.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Item + */ +public class ItemAttributes extends LocatableAttributes { + + public ItemAttributes(CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemStructureAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemStructureAttributes.java new file mode 100644 index 0000000..3421707 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ItemStructureAttributes.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.archetyped.Locatable; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** populate the attributes for RM ItemStructure */ +public class ItemStructureAttributes extends DataStructureAttributes { + + public ItemStructureAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Locatable locatable) { + return super.toMap(locatable); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LinksAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LinksAttributes.java new file mode 100644 index 0000000..84f42cb --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LinksAttributes.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; + +import com.nedap.archie.rm.archetyped.Link; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SimpleClassName; + +/** + * populate the attributes for RM Links + */ +public class LinksAttributes { + + private final List linkList; + + public LinksAttributes(List linkList) { + this.linkList = linkList; + } + + public List> toMap() { + List> links = new ArrayList<>(); + for (Link link : linkList) { + Map valuemap = PathMap.getInstance(); + valuemap.put(TAG_CLASS, new SimpleClassName(link).toString()); + valuemap.put("meaning", link.getMeaning()); + valuemap.put("type", link.getType()); + valuemap.put("target", link.getTarget()); + links.add(valuemap); + } + + return links; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LocatableAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LocatableAttributes.java new file mode 100644 index 0000000..cb1c9f1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/LocatableAttributes.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.archetyped.Locatable; +import java.util.Map; +import org.apache.commons.collections.map.MultiValueMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.NameAsDvText; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.NameInMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.RmObjectEncoding; + +/** + * populate the attributes for RM Locatable Most RM object in a Composition inherit from this class + */ +public abstract class LocatableAttributes extends RMAttributes { + + protected LocatableAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + /** + * map Locatable attributes in a queryable (AQL) form, that is the key follows openEHR RM UML + * conventions lower case, snake_case + * + * @param locatable + * @return + */ + protected Map toMap(Locatable locatable) { + // add complementary attributes + + if (locatable.getArchetypeNodeId() != null) { + map.put(TAG_ARCHETYPE_NODE_ID, locatable.getArchetypeNodeId()); + } + if (locatable.getArchetypeDetails() != null) { + map.put(TAG_ARCHETYPE_DETAILS, new RmObjectEncoding(locatable.getArchetypeDetails()).toMap()); + } + if (locatable.getFeederAudit() != null) { + map.put(TAG_FEEDER_AUDIT, new FeederAuditAttributes(locatable.getFeederAudit()).toMap()); + } + if (locatable.getUid() != null) { + map = toMap(TAG_UID, locatable.getUid(), NO_NAME); + } + if (locatable.getLinks() != null && !locatable.getLinks().isEmpty()) { + map.put(TAG_LINKS, new LinksAttributes(locatable.getLinks()).toMap()); + } + // since name maybe resolved from the archetype node id + if (!map.containsKey(TAG_NAME) && locatable.getName() != null) { + if (map instanceof MultiValueMap) { + map.put(TAG_NAME, new NameAsDvText(locatable.getName()).toMap()); + } else { + new NameInMap(map, new NameAsDvText(locatable.getName()).toMap()).toMap(); + } + } + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ObservationAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ObservationAttributes.java new file mode 100644 index 0000000..5f062ec --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/ObservationAttributes.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.composition.Observation; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Observation + */ +public class ObservationAttributes extends CareEntryAttributes { + + public ObservationAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Observation observation) { + + map = super.toMap(observation); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/OtherParticipationAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/OtherParticipationAttributes.java new file mode 100644 index 0000000..5a1e248 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/OtherParticipationAttributes.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; + +import com.nedap.archie.rm.generic.Participation; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SimpleClassName; + +/** + * populate the attributes for RM OtherParticipations in CareEntry + */ +public class OtherParticipationAttributes { + + private final List participationList; + private final CompositionSerializer compositionSerializer; + + public OtherParticipationAttributes( + List participationList, CompositionSerializer compositionSerializer) { + this.participationList = participationList; + this.compositionSerializer = compositionSerializer; + } + + public List> toMap() { + List> participations = new ArrayList<>(); + for (Participation participation : participationList) { + Map valuemap = PathMap.getInstance(); + valuemap.put(TAG_CLASS, new SimpleClassName(participation).toString()); + valuemap.put("function", participation.getFunction()); + valuemap.put("mode", participation.getMode()); + valuemap.put("time", participation.getTime()); + valuemap.put( + "performer", new SubjectAttributes(participation.getPerformer(), compositionSerializer).toMap()); + participations.add(valuemap); + } + + return participations; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyIdentifiedAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyIdentifiedAttributes.java new file mode 100644 index 0000000..7127791 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyIdentifiedAttributes.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; + +import com.nedap.archie.rm.generic.PartyIdentified; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; + +/** + * populate the attributes for RM PartyIdentified + */ +public class PartyIdentifiedAttributes implements I_SubjectAttributes { + + PartyIdentified partyIdentified; + CompositionSerializer compositionSerializer; + + public PartyIdentifiedAttributes(PartyIdentified partyIdentified, CompositionSerializer compositionSerializer) { + this.partyIdentified = partyIdentified; + this.compositionSerializer = compositionSerializer; + } + + public Map toMap() { + Map valuemap = PathMap.getInstance(); + + valuemap.put(TAG_CLASS, partyIdentified.getClass().getSimpleName()); + + valuemap.put("external_ref", partyIdentified.getExternalRef()); + valuemap.put("name", partyIdentified.getName()); + if (!partyIdentified.getIdentifiers().isEmpty()) valuemap.put("identifiers", partyIdentified.getIdentifiers()); + + return valuemap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyRelatedAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyRelatedAttributes.java new file mode 100644 index 0000000..ac5b56b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartyRelatedAttributes.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.generic.PartyRelated; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * populate the attributes for RM PartyRelated + */ +public class PartyRelatedAttributes implements I_SubjectAttributes { + + PartyRelated partyRelated; + CompositionSerializer compositionSerializer; + + public PartyRelatedAttributes(PartyRelated partyRelated, CompositionSerializer compositionSerializer) { + this.partyRelated = partyRelated; + this.compositionSerializer = compositionSerializer; + } + + public Map toMap() { + Map valuemap = new PartyIdentifiedAttributes(partyRelated, compositionSerializer).toMap(); + valuemap.put("relationship", partyRelated.getRelationship()); + + return valuemap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartySelfAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartySelfAttributes.java new file mode 100644 index 0000000..a78e38b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/PartySelfAttributes.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.TAG_CLASS; + +import com.nedap.archie.rm.generic.PartySelf; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.SnakeCase; + +/** populate the attributes for RM PartySelf */ +public class PartySelfAttributes implements I_SubjectAttributes { + + PartySelf partySelf; + CompositionSerializer compositionSerializer; + + public PartySelfAttributes(PartySelf partySelf, CompositionSerializer compositionSerializer) { + this.partySelf = partySelf; + this.compositionSerializer = compositionSerializer; + } + + public Map toMap() { + Map valuemap = PathMap.getInstance(); + + valuemap.put(TAG_CLASS, partySelf.getClass().getSimpleName()); + valuemap.put(I_DvTypeAdapter.AT_TYPE, new SnakeCase(partySelf.getClass().getSimpleName()).camelToUpperSnake()); + + return valuemap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/RMAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/RMAttributes.java new file mode 100644 index 0000000..c7572f2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/RMAttributes.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import static org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer.*; + +import com.nedap.archie.rm.datavalues.DvText; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.NameAsDvText; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.PathMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SerialTree; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.SimpleClassName; + +/** + * populate the attributes for RM Observation. Root class for all attribute mapping + */ +public abstract class RMAttributes { + + protected final WalkerOutputMode tagMode; + protected final ItemStack itemStack; + protected Map map; + protected CompositionSerializer compositionSerializer; + + public RMAttributes(CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + this.tagMode = compositionSerializer.tagMode(); + this.itemStack = itemStack; + this.map = map; + this.compositionSerializer = compositionSerializer; + } + + /** + * encode a single value for example activity timing + * @param tag + * @param value + */ + protected Map toMap(String tag, Object value, DvText name) { + Map valuemap; + // CHC: 160317 make name optional ex: timing + if (name != null && !map.containsKey(TAG_NAME)) { + valuemap = PathMap.getInstance(); + map.putAll(new SerialTree(valuemap).insert(null, value, TAG_NAME, new NameAsDvText(name).toMap())); + } + + // CHC: 160317 make value optional ex. simple name for activity + if (value != null) { + valuemap = PathMap.getInstance(); + valuemap = new SerialTree(valuemap).insert(new SimpleClassName(value).toString(), value, TAG_VALUE, value); + map.put(tag, valuemap); + } + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SectionAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SectionAttributes.java new file mode 100644 index 0000000..89732d3 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SectionAttributes.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.composition.Section; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.ItemStack; + +/** + * populate the attributes for RM Section + */ +public class SectionAttributes extends ContentItemAttributes { + + public SectionAttributes( + CompositionSerializer compositionSerializer, ItemStack itemStack, Map map) { + super(compositionSerializer, itemStack, map); + } + + public Map toMap(Section section) { + + map = super.toMap(section); + + return map; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SubjectAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SubjectAttributes.java new file mode 100644 index 0000000..6c81d02 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/SubjectAttributes.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes; + +import com.nedap.archie.rm.generic.PartyIdentified; +import com.nedap.archie.rm.generic.PartyRelated; +import com.nedap.archie.rm.generic.PartySelf; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * populate the attributes for RM PartyProxy specialization + */ +public class SubjectAttributes { + + private final I_SubjectAttributes iSubjectAttributes; + + public SubjectAttributes(Object subject, CompositionSerializer compositionSerializer) { + + if (subject instanceof PartySelf) + iSubjectAttributes = new PartySelfAttributes((PartySelf) subject, compositionSerializer); + else if (subject instanceof PartyRelated) + iSubjectAttributes = new PartyRelatedAttributes((PartyRelated) subject, compositionSerializer); + else if (subject instanceof PartyIdentified) + iSubjectAttributes = new PartyIdentifiedAttributes((PartyIdentified) subject, compositionSerializer); + else throw new IllegalStateException("Could not handle subject of type:" + subject.getClass()); + } + + public Map toMap() { + return iSubjectAttributes.toMap(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateAttributes.java new file mode 100644 index 0000000..018df64 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateAttributes.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime; + +public interface I_DateAttributes extends I_TemporalAttributes { + + /** + * true if the date is an RM DvDate instance + * @see com.nedap.archie.rm.datavalues.quantity.datetime.DvDate + */ + boolean isRmDvDate(); + + /** + * true if the date is partial with year only + */ + boolean isDateYYYY(); + + /** + * true if the date is partial with year-month only + */ + boolean isDateYYYYMM(); + + /** + * true if date is ISO8601 canonical + */ + boolean isDateYYYYMMDD(); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateTimeAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateTimeAttributes.java new file mode 100644 index 0000000..18fbb87 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_DateTimeAttributes.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime; + +import java.time.ZoneOffset; + +public interface I_DateTimeAttributes extends I_TemporalAttributes { + /** + * @return true if the date/time is a RM DvDateTime + * @see com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime + */ + boolean isRmDvDateTime(); + + /** + * @return true if the date/time is partial with year only + */ + boolean isDateTimeYYYY(); + + /** + * @return true if the date/time is partial with year-month only + */ + boolean isDateTimeYYYYMM(); + + /** + * @return true if the date/time is partial with year-month-day only + */ + boolean isDateTimeYYYYMMDD(); + + /** + * @return true if the date/time is partial with year-month-day-hour only + * NB. this is never true as a partial time with hours only is always + * converted to hh:00 by the Java API + */ + boolean isDateTimeYYYYMMDDHH(); + + /** + * @return true if the date/time is partial with year-month-day-hour-minutes only + */ + boolean isDateTimeYYYYMMDDHHMM(); + + /** + * @return true if the date/time is partial with year-month-day-hour-minutes-seconds only + */ + boolean isDateTimeYYYYMMDDHHMMSS(); + + /** + * @return true if the date/time is partial with year-month-day-hour-minutes-millisecs + */ + boolean isDateTimeYYYYMMDDHHMMSSmmm(); + + /** + * @return return the Zone Offset for this date/time + */ + ZoneOffset getZoneOffset(); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_PartialTime.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_PartialTime.java new file mode 100644 index 0000000..ce59b5f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_PartialTime.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime; + +/** + * handles specific time String representation evaluation + */ +public interface I_PartialTime { + + /** + * true if time is hh:mm:ss:mmm + */ + boolean ishhmmssfff(); + + /** + * true if time is hh:mm:ss + */ + boolean ishhmmss(); + + /** + * true if time is hh:mm + */ + boolean ishhmm(); + + /** + * true if time is hh + * NB. never true with the current Java API + */ + boolean ishh(); + + /** + * true if a Zone Offset is present + */ + boolean hasTZString(); + + /** + * true if format: HH:MM:SS:mmm + */ + boolean isNonCompactIS8601Representation(); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TemporalAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TemporalAttributes.java new file mode 100644 index 0000000..560bc13 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TemporalAttributes.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime; + +import java.time.temporal.Temporal; + +public interface I_TemporalAttributes { + + /** + * get the epoch offset from a defaulted representation if applicable. + * @see I_TemporalAttributes::getValueExtended() + * @return Long + */ + Long getMagnitude(); + + /** + * return the value passed as an argument to the decorator + * @return Temporal + */ + Temporal getValueAsProvided(); + + /** + * default the missing fields according the argument class. + * f.e. + * - 2019-12 -> 2019-12-01 for a DvDate + * - 2019-12 -> 2019-12-01T00:00:00 for a DvDateTime + * + * @return Temporal + */ + Temporal getValueExtended(); + + /** + * return a bitmask of the supported ChronoFields for this argument + * @link ChronoFields + * @return a bitmask as in {@link TemporalAttributes} + */ + Integer getSupportedChronoFields(); + + /** + * @return return the timestamp calculated from the extended representation as a full ISO8601 date/time + * that is for a DvDate, it is converted to its ISO8601 equivalent (YYYY-MM-DDThh:mm:ss[TZ]) + */ + Long getTimeStamp(); + + /** + * return the formatter to use to represent this argument as String from SQL + * @param bitmask bit map + * @return the formatter string + */ + String getISOdateTimeSQLFormatter(Integer bitmask); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TimeAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TimeAttributes.java new file mode 100644 index 0000000..1df5db6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/I_TimeAttributes.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime; + +import java.time.ZoneOffset; + +public interface I_TimeAttributes extends I_TemporalAttributes { + + /** + * true if time is an RM DvTime instance + */ + boolean isRmDvTime(); + + /** + * true if time is hours only + * NB. never true with current Java API which defaults it to HH:MM + */ + boolean isTimeHH(); + + /** + * true if time is hours-minutes only + */ + boolean isTimeHHMM(); + + /** + * true if time is hours-minutes-seconds only + */ + boolean isTimeHHMMSS(); + + /** + * true if time is hours-minutes-seconds-millisecs only + */ + boolean isTimeHHMMSSmmm(); + + /** + * return the zone offset for this time if any + * @return ZoneOffset + */ + ZoneOffset getZoneOffset(); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/TemporalAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/TemporalAttributes.java new file mode 100644 index 0000000..ffc6b05 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/TemporalAttributes.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime; + +import java.util.HashMap; +import java.util.Map; + +public abstract class TemporalAttributes implements I_TemporalAttributes { + + protected TemporalAttributes() {} + + /** + * ChronoField as bitmask + * 4 bytes + * 76543210765432107654321076543210 + * 00000000000000000000000000000000 + * type + ext. + date + time + + * ext -> future extensions if applicable + **/ + public static final int DV_DATE = 0b00000001000000000000000000000000; + + public static final int DV_TIME = 0b00000010000000000000000000000000; + public static final int DV_DATE_TIME = 0b00000100000000000000000000000000; + public static final int MILLI_OF_SECOND = 0b00000000000000000000000000000001; + public static final int SECOND_OF_MINUTE = 0b00000000000000000000000000000010; + public static final int MINUTE_OF_HOUR = 0b00000000000000000000000000000100; + public static final int HOUR = 0b00000000000000000000000000001000; + public static final int DAY_OF_MONTH = 0b00000000000000000000000100000000; + public static final int MONTH_OF_YEAR = 0b00000000000000000000001000000000; + public static final int YEAR = 0b00000000000000000000010000000000; + + /** + * SQL formatter depending on the actual bitmask and attributes + * to be used with to_char(timestamp, text) (https://www.postgresql.org/docs/current/functions-formatting.html) + */ + protected static final Map ISODateTimeSQLFormatters = new HashMap<>(); + + static { + // Non partial representations + ISODateTimeSQLFormatters.put(DV_DATE, "YYYY-MM-DD"); + ISODateTimeSQLFormatters.put(DV_TIME, "HH24:MI:SS.MS"); + ISODateTimeSQLFormatters.put(DV_DATE_TIME, "YYYY-MM-DD\"T\"HH24:MI:SS.MS"); + // DvDate + ISODateTimeSQLFormatters.put(DV_DATE | YEAR, "YYYY"); + ISODateTimeSQLFormatters.put(DV_DATE | YEAR | MONTH_OF_YEAR, "YYYY-MM"); + ISODateTimeSQLFormatters.put(DV_DATE | YEAR | MONTH_OF_YEAR | DAY_OF_MONTH, "YYYY-MM-DD"); + // DvDateTime + ISODateTimeSQLFormatters.put(DV_DATE_TIME | YEAR, "YYYY"); + ISODateTimeSQLFormatters.put(DV_DATE_TIME | YEAR | MONTH_OF_YEAR, "YYYY-MM"); + ISODateTimeSQLFormatters.put(DV_DATE_TIME | YEAR | MONTH_OF_YEAR | DAY_OF_MONTH, "YYYY-MM-DD"); + ISODateTimeSQLFormatters.put( + DV_DATE_TIME | YEAR | MONTH_OF_YEAR | DAY_OF_MONTH | HOUR, "YYYY-MM-DD\"T\"HH24:00"); + ISODateTimeSQLFormatters.put( + DV_DATE_TIME | YEAR | MONTH_OF_YEAR | DAY_OF_MONTH | HOUR | MINUTE_OF_HOUR, "YYYY-MM-DD\"T\"HH24:MI"); + ISODateTimeSQLFormatters.put( + DV_DATE_TIME | YEAR | MONTH_OF_YEAR | DAY_OF_MONTH | HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE, + "YYYY-MM-DD\"T\"HH24:MI:SS"); + ISODateTimeSQLFormatters.put( + DV_DATE_TIME + | YEAR + | MONTH_OF_YEAR + | DAY_OF_MONTH + | HOUR + | MINUTE_OF_HOUR + | SECOND_OF_MINUTE + | MILLI_OF_SECOND, + "YYYY-MM-DD\"T\"HH24:MI:SS"); + // DvTime + ISODateTimeSQLFormatters.put(DV_TIME | HOUR, "YYYY-MM-DD\"T\"HH24:00"); + ISODateTimeSQLFormatters.put(DV_TIME | HOUR | MINUTE_OF_HOUR, "YYYY-MM-DD\"T\"HH24:MI"); + ISODateTimeSQLFormatters.put(DV_TIME | HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE, "YYYY-MM-DD\"T\"HH24:MI:SS"); + ISODateTimeSQLFormatters.put( + DV_TIME | HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE | MILLI_OF_SECOND, "YYYY-MM-DD\"T\"HH24:MI:SS"); + } + + public String getISOdateTimeSQLFormatter(Integer bitmask) { + return ISODateTimeSQLFormatters.get(bitmask); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributes.java new file mode 100644 index 0000000..48e2eea --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributes.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import java.time.temporal.ChronoField; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_DateAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +/** + * decorator for DvDate. + * Add attributes and handling for partial date (f.e. 2019-12) + * Provide a defaulted representation (f.e. 2019-12-01 for the above) + * Calculate a timestamp based on the defaulted representation + */ +public class DvDateAttributes extends TemporalAttributes implements I_DateAttributes { + + private I_DateAttributes dateAttributes; + + private DvDateAttributes(I_DateAttributes dateAttributes) { + this.dateAttributes = dateAttributes; + } + + public static DvDateAttributes instanceFromValue(DvDate dvDate) { + I_DateAttributes dateAttributes; + + if (dvDate.getValue().isSupported(ChronoField.YEAR) + && dvDate.getValue().isSupported(ChronoField.MONTH_OF_YEAR) + && dvDate.getValue().isSupported(ChronoField.DAY_OF_MONTH)) { + dateAttributes = new DvDateYYYYMMDDImp(dvDate); + } else if (dvDate.getValue().isSupported(ChronoField.YEAR) + && dvDate.getValue().isSupported(ChronoField.MONTH_OF_YEAR)) { + dateAttributes = new DvDateYYYYMMImp(dvDate); + } else if (dvDate.getValue().isSupported(ChronoField.YEAR)) { + dateAttributes = new DvDateYYYYImp(dvDate); + } else + throw new IllegalArgumentException( + "Invalid date:" + dvDate.getValue().toString()); + + return new DvDateAttributes(dateAttributes); + } + + @Override + public Long getMagnitude() { + return dateAttributes.getMagnitude(); + } + + @Override + public Temporal getValueAsProvided() { + return dateAttributes.getValueAsProvided(); + } + + @Override + public Temporal getValueExtended() { + return dateAttributes.getValueExtended(); + } + + @Override + public Integer getSupportedChronoFields() { + return dateAttributes.getSupportedChronoFields(); + } + + @Override + public Long getTimeStamp() { + return null; + } + + @Override + public boolean isRmDvDate() { + return dateAttributes.isRmDvDate(); + } + + @Override + public boolean isDateYYYY() { + return dateAttributes.isDateYYYY(); + } + + @Override + public boolean isDateYYYYMM() { + return dateAttributes.isDateYYYYMM(); + } + + @Override + public boolean isDateYYYYMMDD() { + return dateAttributes.isDateYYYYMMDD(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributesImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributesImp.java new file mode 100644 index 0000000..940755a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateAttributesImp.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_DateAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +public abstract class DvDateAttributesImp extends TemporalAttributes implements I_DateAttributes { + + protected final DvDate dvDate; + + public DvDateAttributesImp(DvDate dvDate) { + this.dvDate = dvDate; + } + + @Override + public Temporal getValueAsProvided() { + return dvDate.getValue(); + } + + @Override + public Long getMagnitude() { + return LocalDate.from(getValueExtended()).toEpochDay(); + } + + @Override + public Long getTimeStamp() { + return LocalDateTime.from(LocalDate.parse(getValueExtended().toString() + "T00:00:00")) + .toEpochSecond(ZoneOffset.UTC); + } + + public Integer supportedChronoFields(Integer chronoFieldBitmask) { + return TemporalAttributes.DV_DATE | chronoFieldBitmask; + } + + @Override + public boolean isRmDvDate() { + return (getSupportedChronoFields() & DV_DATE) == DV_DATE; + } + + @Override + public boolean isDateYYYY() { + return getSupportedChronoFields() == (DV_DATE | YEAR); + } + + @Override + public boolean isDateYYYYMM() { + return getSupportedChronoFields() == (DV_DATE | YEAR | MONTH_OF_YEAR); + } + + @Override + public boolean isDateYYYYMMDD() { + return getSupportedChronoFields() == (DV_DATE | YEAR | MONTH_OF_YEAR | DAY_OF_MONTH); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYImp.java new file mode 100644 index 0000000..c5cdcdb --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYImp.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import java.time.LocalDate; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +/** + * full date time representation with millisecs + */ +public class DvDateYYYYImp extends DvDateAttributesImp { + + public DvDateYYYYImp(DvDate dvDate) { + super(dvDate); + } + + @Override + public Long getMagnitude() { + return null; + } + + @Override + public Temporal getValueExtended() { + return LocalDate.parse(dvDate.getValue() + "-01-01"); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields(TemporalAttributes.YEAR); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMDDImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMDDImp.java new file mode 100644 index 0000000..674fc76 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMDDImp.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +/** + * full date time representation with millisecs + */ +public class DvDateYYYYMMDDImp extends DvDateAttributesImp { + + public DvDateYYYYMMDDImp(DvDate dvDate) { + super(dvDate); + } + + @Override + public Temporal getValueExtended() { + return dvDate.getValue(); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields( + TemporalAttributes.YEAR | TemporalAttributes.MONTH_OF_YEAR | TemporalAttributes.DAY_OF_MONTH); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMImp.java new file mode 100644 index 0000000..5009dd9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/date/DvDateYYYYMMImp.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import java.time.LocalDate; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +/** + * full date time representation with millisecs + */ +public class DvDateYYYYMMImp extends DvDateAttributesImp { + + public DvDateYYYYMMImp(DvDate dvDate) { + super(dvDate); + } + + @Override + public Temporal getValueExtended() { + return LocalDate.parse(dvDate.getValue() + "-01"); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields(TemporalAttributes.YEAR | TemporalAttributes.MONTH_OF_YEAR); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/datetime/DvDateTimeAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/datetime/DvDateTimeAttributes.java new file mode 100644 index 0000000..a174948 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/datetime/DvDateTimeAttributes.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.datetime; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.Year; +import java.time.YearMonth; +import java.time.ZoneOffset; +import java.time.temporal.ChronoField; +import java.time.temporal.Temporal; +import java.time.temporal.TemporalAccessor; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_DateAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_DateTimeAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_TimeAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date.DvDateAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time.DvTimeAttributes; + +/** + * decorator for DvDateTime. + * Add attributes and handling for partial date/time (f.e. 2019-12) + * Provide a defaulted representation (f.e. 2019-12-01:00:00:00Z for the above) + * Calculate a timestamp based on the defaulted representation + */ +public class DvDateTimeAttributes extends TemporalAttributes implements I_DateTimeAttributes { + + protected DvDateTime dvDateTime; + protected I_DateAttributes datePart; + protected I_TimeAttributes timePart; + protected ZoneOffset zoneOffset; + + private DvDateTimeAttributes(DvDateTime dvDateTime, I_DateAttributes datePart, I_TimeAttributes timePart) { + this.dvDateTime = dvDateTime; + this.datePart = datePart; + this.timePart = timePart; + this.zoneOffset = timePart == null ? null : timePart.getZoneOffset(); + } + + public static DvDateTimeAttributes instanceFromValue(DvDateTime dvDateTime) { + + TemporalAccessor localDate; + TemporalAccessor actual = dvDateTime.getValue(); + + if (actual.isSupported(ChronoField.YEAR) + && actual.isSupported(ChronoField.MONTH_OF_YEAR) + && actual.isSupported(ChronoField.DAY_OF_MONTH)) + localDate = LocalDate.of( + actual.get(ChronoField.YEAR), + actual.get(ChronoField.MONTH_OF_YEAR), + actual.get(ChronoField.DAY_OF_MONTH)); + else if (actual.isSupported(ChronoField.YEAR) && actual.isSupported(ChronoField.MONTH_OF_YEAR)) + localDate = YearMonth.of(actual.get(ChronoField.YEAR), actual.get(ChronoField.MONTH_OF_YEAR)); + else if (actual.isSupported(ChronoField.YEAR)) localDate = Year.of(actual.get(ChronoField.YEAR)); + else throw new IllegalArgumentException("DvDateTime supplied is not valid:" + actual); + + DvTimeAttributes dvTimeAttributes = DvTimeAttributes.instanceFromValue(dvDateTime.getValue()); + DvDateAttributes dvDateAttributes = DvDateAttributes.instanceFromValue(new DvDate((Temporal) localDate)); + + if (dvTimeAttributes == null) { + dvDateTime = new DvDateTime(dvDateAttributes.getValueAsProvided()); + } + + return new DvDateTimeAttributes(dvDateTime, dvDateAttributes, dvTimeAttributes); + } + + @Override + public Long getMagnitude() { + return LocalDate.from(getValueExtended()).toEpochDay(); + } + + @Override + public Temporal getValueAsProvided() { + return (Temporal) dvDateTime.getValue(); + } + + @Override + public Temporal getValueExtended() { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(datePart.getValueExtended()); + stringBuilder.append("T"); + stringBuilder.append(timePart == null ? "00:00:00" : timePart.getValueExtended()); + if (zoneOffset != null) return OffsetDateTime.parse(stringBuilder.toString()); + else return LocalDateTime.parse(stringBuilder.toString()); + } + + @Override + public Integer getSupportedChronoFields() { + return TemporalAttributes.DV_DATE_TIME + | (datePart.getSupportedChronoFields() & ~TemporalAttributes.DV_DATE) + | (timePart == null ? 0 : timePart.getSupportedChronoFields() & ~TemporalAttributes.DV_TIME); + } + + @Override + public Long getTimeStamp() { + if (zoneOffset == null) + return LocalDateTime.parse(getValueExtended().toString()).toEpochSecond(ZoneOffset.UTC); + else return OffsetDateTime.parse(getValueExtended().toString()).toEpochSecond(); + } + + @Override + public boolean isRmDvDateTime() { + if (timePart == null) return false; + return datePart.isDateYYYYMMDD() && (timePart.isTimeHHMMSSmmm() || timePart.isTimeHHMMSS()); + } + + @Override + public boolean isDateTimeYYYY() { + return datePart.isDateYYYY(); + } + + @Override + public boolean isDateTimeYYYYMM() { + return datePart.isDateYYYYMM(); + } + + @Override + public boolean isDateTimeYYYYMMDD() { + return datePart.isDateYYYYMMDD(); + } + + @Override + public boolean isDateTimeYYYYMMDDHH() { + if (timePart == null) return false; + return datePart.isDateYYYYMMDD() && timePart.isTimeHH(); + } + + @Override + public boolean isDateTimeYYYYMMDDHHMM() { + if (timePart == null) return false; + return datePart.isDateYYYYMMDD() && timePart.isTimeHHMM(); + } + + @Override + public boolean isDateTimeYYYYMMDDHHMMSS() { + if (timePart == null) return false; + return datePart.isDateYYYYMMDD() && timePart.isTimeHHMMSS(); + } + + @Override + public boolean isDateTimeYYYYMMDDHHMMSSmmm() { + if (timePart == null) return false; + return datePart.isDateYYYYMMDD() && timePart.isTimeHHMMSSmmm(); + } + + @Override + public ZoneOffset getZoneOffset() { + return zoneOffset; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributes.java new file mode 100644 index 0000000..86fdf90 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributes.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.LocalTime; +import java.time.OffsetTime; +import java.time.ZoneOffset; +import java.time.temporal.ChronoField; +import java.time.temporal.Temporal; +import java.time.temporal.TemporalAccessor; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_PartialTime; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_TimeAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +/** + * decorator for DvTime. + * Add attributes and handling for partial time (f.e. 10:00) + * Provide a defaulted representation (f.e. 10:00:00 for the above) + * Calculate a timestamp based on the defaulted representation + */ +public class DvTimeAttributes extends TemporalAttributes implements I_TimeAttributes { + + private I_TimeAttributes timeAttributes; + private static ZoneOffset zoneOffset; + + private DvTimeAttributes(I_TimeAttributes timeAttributes) { + this.timeAttributes = timeAttributes; + } + + public static DvTimeAttributes instanceFromValue(TemporalAccessor timeValue) { + + if (!timeValue.isSupported(ChronoField.HOUR_OF_DAY)) return null; + + try { + zoneOffset = ZoneOffset.from(timeValue); + } catch (Exception e) { + zoneOffset = null; + } + + if (zoneOffset != null) { + OffsetTime offsetTime = OffsetTime.of( + timeValue.get(ChronoField.HOUR_OF_DAY), + timeValue.get(ChronoField.MINUTE_OF_HOUR), + timeValue.get(ChronoField.SECOND_OF_MINUTE), + timeValue.get(ChronoField.NANO_OF_SECOND), + zoneOffset); + + return instanceFromValue(new DvTime(offsetTime)); + } else { + LocalTime localTime = LocalTime.of( + timeValue.get(ChronoField.HOUR_OF_DAY), + timeValue.get(ChronoField.MINUTE_OF_HOUR), + timeValue.get(ChronoField.SECOND_OF_MINUTE), + timeValue.get(ChronoField.NANO_OF_SECOND)); + return instanceFromValue(new DvTime(localTime)); + } + } + + public static DvTimeAttributes instanceFromValue(DvTime dvTime) { + I_TimeAttributes timeAttributes; + I_PartialTime partialTime = PartialTime.getInstance(dvTime); + + if (partialTime.ishhmmssfff()) { + timeAttributes = new DvTimehhmmssfffImp(dvTime); + } else if (partialTime.ishhmmss()) { + timeAttributes = new DvTimehhmmssImp(dvTime); + } else if (partialTime.ishhmm()) { + timeAttributes = new DvTimehhmmImp(dvTime); + } else if (partialTime.ishh()) { + timeAttributes = new DvTimehhImp(dvTime); + } else + throw new IllegalArgumentException( + "Invalid time:" + dvTime.getValue().toString()); + + return new DvTimeAttributes(timeAttributes); + } + + @Override + public Long getMagnitude() { + return timeAttributes.getMagnitude(); + } + + @Override + public Temporal getValueAsProvided() { + return timeAttributes.getValueAsProvided(); + } + + @Override + public Temporal getValueExtended() { + return timeAttributes.getValueExtended(); + } + + @Override + public Integer getSupportedChronoFields() { + return timeAttributes.getSupportedChronoFields(); + } + + @Override + public Long getTimeStamp() { + return timeAttributes.getTimeStamp(); + } + + @Override + public boolean isRmDvTime() { + return timeAttributes.isRmDvTime(); + } + + @Override + public boolean isTimeHH() { + return timeAttributes.isTimeHH(); + } + + @Override + public boolean isTimeHHMM() { + return timeAttributes.isTimeHHMM(); + } + + @Override + public boolean isTimeHHMMSS() { + return timeAttributes.isTimeHHMMSS(); + } + + @Override + public boolean isTimeHHMMSSmmm() { + return timeAttributes.isTimeHHMMSSmmm(); + } + + @Override + public ZoneOffset getZoneOffset() { + return zoneOffset; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributesImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributesImp.java new file mode 100644 index 0000000..3b29710 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimeAttributesImp.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.ZoneOffset; +import java.time.temporal.ChronoField; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_TimeAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +abstract class DvTimeAttributesImp extends TemporalAttributes implements I_TimeAttributes { + + protected final DvTime dvTime; + protected ZoneOffset zoneOffset; + + DvTimeAttributesImp(DvTime dvTime) { + super(); + this.dvTime = dvTime; + if (dvTime.getValue().isSupported(ChronoField.OFFSET_SECONDS)) zoneOffset = ZoneOffset.from(dvTime.getValue()); + } + + @Override + public Temporal getValueAsProvided() { + return (Temporal) dvTime.getValue(); + } + + @Override + public Long getMagnitude() { + return Math.round(dvTime.getMagnitude()); + } + + @Override + public Long getTimeStamp() { + // since time is not related to a date, return the magnitude + return getMagnitude(); + } + + public Integer supportedChronoFields(Integer chronoFieldBitmask) { + return TemporalAttributes.DV_TIME | chronoFieldBitmask; + } + + @Override + public boolean isRmDvTime() { + return (getSupportedChronoFields() & DV_TIME) == DV_TIME; + } + + @Override + public boolean isTimeHH() { + return getSupportedChronoFields() == (DV_TIME | HOUR); + } + + @Override + public boolean isTimeHHMM() { + return getSupportedChronoFields() == (DV_TIME | HOUR | MINUTE_OF_HOUR); + } + + @Override + public boolean isTimeHHMMSS() { + return getSupportedChronoFields() == (DV_TIME | HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE); + } + + @Override + public boolean isTimeHHMMSSmmm() { + return getSupportedChronoFields() == (DV_TIME | HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE | MILLI_OF_SECOND); + } + + @Override + public ZoneOffset getZoneOffset() { + return zoneOffset; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhImp.java new file mode 100644 index 0000000..dda1d4b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhImp.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.LocalTime; +import java.time.OffsetTime; +import java.time.temporal.ChronoField; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +public class DvTimehhImp extends DvTimeAttributesImp { + + public DvTimehhImp(DvTime dvTime) { + super(dvTime); + } + + @Override + public Temporal getValueExtended() { + if (zoneOffset != null) + return OffsetTime.parse(dvTime.getValue() + ":00:00" + zoneOffset.get(ChronoField.OFFSET_SECONDS)); + else return LocalTime.parse(dvTime.getValue() + ":00:00"); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields(TemporalAttributes.HOUR); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmImp.java new file mode 100644 index 0000000..aecc36e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmImp.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.LocalTime; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +public class DvTimehhmmImp extends DvTimeAttributesImp { + + public DvTimehhmmImp(DvTime dvTime) { + super(dvTime); + } + + @Override + public Temporal getValueExtended() { + if (zoneOffset != null) return (Temporal) dvTime.getValue(); + else return LocalTime.parse(dvTime.getValue() + ":00"); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields(TemporalAttributes.HOUR | MINUTE_OF_HOUR); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssImp.java new file mode 100644 index 0000000..6a51d09 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssImp.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +public class DvTimehhmmssImp extends DvTimeAttributesImp { + + public DvTimehhmmssImp(DvTime dvTime) { + super(dvTime); + } + + @Override + public Temporal getValueExtended() { + return (Temporal) dvTime.getValue(); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields(TemporalAttributes.HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssfffImp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssfffImp.java new file mode 100644 index 0000000..94f6e57 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/DvTimehhmmssfffImp.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.temporal.Temporal; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.TemporalAttributes; + +public class DvTimehhmmssfffImp extends DvTimeAttributesImp { + + public DvTimehhmmssfffImp(DvTime dvTime) { + super(dvTime); + } + + @Override + public Temporal getValueExtended() { + return (Temporal) dvTime.getValue(); + } + + @Override + public Integer getSupportedChronoFields() { + return supportedChronoFields(TemporalAttributes.HOUR | MINUTE_OF_HOUR | SECOND_OF_MINUTE | MILLI_OF_SECOND); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/PartialTime.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/PartialTime.java new file mode 100644 index 0000000..29dabc8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/PartialTime.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.time.ZoneOffset; +import java.time.temporal.ChronoField; +import org.apache.commons.lang3.StringUtils; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.I_PartialTime; + +public abstract class PartialTime implements I_PartialTime { + + String timeZoneString; + String dvTimeRepresentation; + + protected PartialTime(DvTime dvTime) { + this.dvTimeRepresentation = dvTime.getValue().toString(); + + if (dvTime.getValue().isSupported(ChronoField.OFFSET_SECONDS)) { + timeZoneString = ZoneOffset.from(dvTime.getValue()).toString(); + dvTimeRepresentation = StringUtils.remove(dvTimeRepresentation, timeZoneString); + } + } + + public static I_PartialTime getInstance(DvTime dvTime) { + if (dvTime.getValue().toString().contains(":")) return new StandardPartialTime(dvTime); + else throw new IllegalArgumentException("ISO8601 time compact form is not yet supported"); + } + + @Override + public boolean hasTZString() { + return timeZoneString != null; + } + + @Override + public boolean isNonCompactIS8601Representation() { + return dvTimeRepresentation.contains(":"); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/StandardPartialTime.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/StandardPartialTime.java new file mode 100644 index 0000000..dbe38b3 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/attributes/datavalues/datetime/time/StandardPartialTime.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time; + +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; + +public class StandardPartialTime extends PartialTime { + + public StandardPartialTime(DvTime dvTime) { + super(dvTime); + } + + @Override + public boolean ishhmmssfff() { + return dvTimeRepresentation.length() > 8; + } + + @Override + public boolean ishhmmss() { + return dvTimeRepresentation.length() == 8; + } + + @Override + public boolean ishhmm() { + return dvTimeRepresentation.length() == 5; + } + + @Override + public boolean ishh() { + return dvTimeRepresentation.length() == 2; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rawjson/LightRawJsonEncoder.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rawjson/LightRawJsonEncoder.java new file mode 100644 index 0000000..f82b3b4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rawjson/LightRawJsonEncoder.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.rawjson; + +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.internal.LinkedTreeMap; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.EncodeUtilArchie; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw.ArchieCompositionProlog; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw.CompositionRoot; + +/** + * Created by christian on 6/21/2017. + */ +public class LightRawJsonEncoder { + + private String jsonbOrigin; + + public LightRawJsonEncoder(String jsonbOrigin) { + this.jsonbOrigin = jsonbOrigin; + } + + public String encodeContentAsString(String root) { + + Object fromDB = db2map(root != null && root.equals("value")); + + GsonBuilder gsonRaw = EncodeUtilArchie.getGsonBuilderInstance(I_DvTypeAdapter.AdapterType.DBJSON2RAWJSON); + String raw = null; + if (fromDB instanceof Map) { + if (root != null) { + Object contentMap = ((Map) fromDB).get(root); + if (contentMap instanceof LinkedTreeMap && ((LinkedTreeMap) contentMap).size() == 0) // empty content + raw = encodeNullContent(); + else raw = gsonRaw.create().toJson(((Map) fromDB).get(root)); + } else raw = gsonRaw.create().toJson(fromDB); + } + + return raw; + } + + private String encodeNullContent() { + Map nullContentMap = new Hashtable<>(); + nullContentMap.put("content", new ArrayList<>()); + return new GsonBuilder().create().toJson(nullContentMap); + } + + public JsonElement encodeContentAsJson(String root) { + GsonBuilder gsonRaw = EncodeUtilArchie.getGsonBuilderInstance(I_DvTypeAdapter.AdapterType.DBJSON2RAWJSON); + JsonElement jsonElement = gsonRaw.create().toJsonTree(db2map(root != null && root.equals("value"))); + if (root != null) { + // in order to create the canonical form, build the ELEMENT json (hence the type is passed into the embedded + // value) + jsonElement = jsonElement.getAsJsonObject().get(root); + } + + return jsonElement; + } + + public String encodeCompositionAsString() { + // get the composition root key + String root = new CompositionRoot(jsonbOrigin).toString(); + // convert to raw json + String converted = encodeContentAsString(root); + + Map compoMap = (Map) db2map(false); + + String compositionName = (String) ((Map) ((List) compoMap.get("/name")).get(0)).get("value"); + + return converted.replaceFirst( + Pattern.quote("{"), new ArchieCompositionProlog(root, compositionName).toString()); + } + + public Map encodeOtherDetailsAsMap() { + return (Map) db2map(false); + } + + @SuppressWarnings("unchecked") + private Object db2map(boolean isValue) { + boolean isArray = false; + + GsonBuilder gsondb = EncodeUtilArchie.getGsonBuilderInstance(); + if (jsonbOrigin.startsWith("[")) { + if (isValue) { + jsonbOrigin = jsonbOrigin.trim().substring(1, jsonbOrigin.length() - 1); + } else isArray = true; + } + + Object fromDB = gsondb.create().fromJson(jsonbOrigin, isArray ? ArrayList.class : Map.class); + + if (fromDB instanceof Map && ((Map) fromDB).containsKey("content")) { + // push contents upward + Object contents = ((Map) fromDB).get("content"); + + if (contents instanceof LinkedTreeMap) { + for (Object contentItem : ((LinkedTreeMap) contents).entrySet()) { + if (contentItem instanceof Map.Entry) { + ((Map) fromDB) + .put( + ((Map.Entry) contentItem).getKey().toString(), + ((Map.Entry) contentItem).getValue()); + } + } + ((Map) fromDB).remove("content"); + } + } + + return fromDB; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/FeederAuditEncoding.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/FeederAuditEncoding.java new file mode 100644 index 0000000..f4b5f6e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/FeederAuditEncoding.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.rmobject; + +import com.nedap.archie.rm.archetyped.FeederAudit; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.FeederAuditAttributes; + +/** + * Encode/decode a FeederAudit object as a json structure. + * Should be used to support FeederAudit at DB level (f.e. Composition Entry) + */ +public class FeederAuditEncoding extends RMObjectEncoding { + + public String toDB(FeederAudit feederAudit) { + Map objectMap = new FeederAuditAttributes(feederAudit).toMap(); + return super.toDB(objectMap); + } + + public FeederAudit fromDB(String dbJonRepresentation) { + return (FeederAudit) super.fromDB(FeederAudit.class, dbJonRepresentation); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/LinksEncoding.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/LinksEncoding.java new file mode 100644 index 0000000..15c16d9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/LinksEncoding.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.rmobject; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.nedap.archie.rm.archetyped.Link; +import java.util.Arrays; +import java.util.List; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.EncodeUtilArchie; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.ArchieObjectMapperProvider; + +/** + * Encode/decode a Links object as a json structure. Should be used to support FeederAudit at DB + * level (f.e. Composition Entry) + */ +public class LinksEncoding extends RMObjectEncoding { + + public String toDB(List linkList) { + GsonBuilder builder = EncodeUtilArchie.getGsonBuilderInstance(); + Gson gson = builder.setPrettyPrinting().create(); + return gson.toJson(linkList); + } + + public List fromDB(String dbJonRepresentation) { + List list; + try { + list = Arrays.asList( + ArchieObjectMapperProvider.getObjectMapper().readValue(dbJonRepresentation, Link[].class)); + } catch (JsonProcessingException e) { + throw new IllegalArgumentException(); + } + + return list; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/RMObjectEncoding.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/RMObjectEncoding.java new file mode 100644 index 0000000..ec0b937 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/RMObjectEncoding.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.rmobject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.nedap.archie.rm.RMObject; +import com.nedap.archie.rminfo.ArchieRMInfoLookup; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.EncodeUtilArchie; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.rawjson.LightRawJsonEncoder; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.CanonicalJson; + +/** utility class to deal with specific RM object DB encode/decode (f.e. FeederAudit) */ +public abstract class RMObjectEncoding { + + protected String toDB(Map objectMap) { + GsonBuilder builder = EncodeUtilArchie.getGsonBuilderInstance(); + Gson gson = builder.setPrettyPrinting().create(); + return gson.toJson(objectMap); + } + + protected RMObject fromDB(String rmClassName, String dbJonRepresentation) { + Class clazz = ArchieRMInfoLookup.getInstance().getClass(rmClassName); + return fromDB(clazz, dbJonRepresentation); + } + + protected RMObject fromDB(Class clazz, String dbJonRepresentation) { + JsonElement interpreted = new LightRawJsonEncoder(dbJonRepresentation).encodeContentAsJson(null); + return new CanonicalJson().unmarshal(interpreted.toString(), clazz); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/TemporalEncoding.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/TemporalEncoding.java new file mode 100644 index 0000000..af2b314 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/rmobject/TemporalEncoding.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.rmobject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.EncodeUtilArchie; + +public class TemporalEncoding extends RMObjectEncoding { + + // private DvDateTime dvDateTime; + private DvDate dvDate; + + public String toDB(DvDate dvDate) { + GsonBuilder builder = EncodeUtilArchie.getGsonBuilderInstance(); + Gson gson = builder.setPrettyPrinting().create(); + return gson.toJson(dvDate); + } + + // public boolean isPartialYear(){ + // return dvDate.getValue().isSupported(ChronoField.YEAR); + // } + // + // public boolean isPartialYearMonth(){ + // return (dvDate.getValue().isSupported(ChronoField.YEAR) && + // dvDate.getValue().isSupported(ChronoField.MONTH_OF_YEAR)); + // } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/I_DvTypeAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/I_DvTypeAdapter.java new file mode 100644 index 0000000..c6b6e87 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/I_DvTypeAdapter.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json; + +import org.ehrbase.openehr.sdk.util.rmconstants.RmConstants; + +/** + * Created by christian on 10/6/2016. + */ +public interface I_DvTypeAdapter { + + enum AdapterType { + PG_JSONB, + RAW_JSON, + _DBJSON2RAWJSON, + DBJSON2RAWJSON + } + + String matchNodePredicate = + "/(content|protocol|events|data|description|instruction|items|activities|activity|composition|entry|evaluation|observation|action|at)\\[([(0-9)|(A-Z)|(a-z)|\\-|_|\\.]*)\\]"; + + String TAG_CLASS_RAW_JSON = "_type"; + + String NAME = "name"; + String AT_TYPE = "_type"; + String AT_CLASS = AT_TYPE; + String ARCHETYPE_NODE_ID = "archetype_node_id"; + String ITEMS = "items"; + String EVENTS = "events"; + String VALUE = "value"; + String ELEMENT = RmConstants.ELEMENT; +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/CodePhraseAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/CodePhraseAdapter.java new file mode 100644 index 0000000..e969a1a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/CodePhraseAdapter.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datatypes.CodePhrase; +import java.io.IOException; +import java.util.Optional; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class CodePhraseAdapter extends DvTypeAdapter { + + private TerminologyIDAdapter terminologyIDAdapter; + + public CodePhraseAdapter(AdapterType adapterType) { + super(adapterType); + terminologyIDAdapter = new TerminologyIDAdapter(adapterType); + } + + public CodePhraseAdapter() { + super(); + terminologyIDAdapter = new TerminologyIDAdapter(adapterType); + } + + @Override + public CodePhrase read(JsonReader arg0) throws IOException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void write(JsonWriter writer, CodePhrase codePhrase) throws IOException { + if (codePhrase == null) { + writer.nullValue(); + return; + } + Optional preferredTerm = Optional.of(codePhrase).map(CodePhrase::getPreferredTerm); + if (adapterType == I_DvTypeAdapter.AdapterType.PG_JSONB + || adapterType == I_DvTypeAdapter.AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name(TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(codePhrase).camelToUpperSnake()); + writer.name("code_string").value(codePhrase.getCodeString()); + writer.name("terminology_id"); + terminologyIDAdapter.write(writer, codePhrase.getTerminologyId()); + if (preferredTerm.isPresent()) { + writer.name("preferred_term").value(preferredTerm.get()); + } + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvCodedTextAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvCodedTextAdapter.java new file mode 100644 index 0000000..9dd1dda --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvCodedTextAdapter.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.datavalues.DvCodedText; +import java.io.IOException; +import java.util.Optional; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class DvCodedTextAdapter extends DvTypeAdapter { + private final CodePhraseAdapter codePhraseAdapter; + + public DvCodedTextAdapter(AdapterType adapterType) { + super(adapterType); + codePhraseAdapter = new CodePhraseAdapter(adapterType); + } + + public DvCodedTextAdapter() { + super(); + codePhraseAdapter = new CodePhraseAdapter(adapterType); + } + + @Override + public DvCodedText read(JsonReader arg0) { + return null; + } + + @Override + public void write(JsonWriter writer, DvCodedText dvalue) throws IOException { + if (dvalue == null + || Optional.of(dvalue) + .map(DvCodedText::getDefiningCode) + .map(CodePhrase::getCodeString) + .isEmpty()) { + writer.nullValue(); + return; + } + + TermMappingAdapter termMappingAdapter = new TermMappingAdapter(adapterType); + if (adapterType == I_DvTypeAdapter.AdapterType.PG_JSONB + || adapterType == I_DvTypeAdapter.AdapterType.RAW_JSON) { + writeDvCodedText(writer, dvalue, termMappingAdapter); + } + } + + private void writeDvCodedText(JsonWriter writer, DvCodedText dvalue, TermMappingAdapter termMappingAdapter) + throws IOException { + writer.beginObject(); + writer.name(TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(dvalue).camelToUpperSnake()); + writer.name(VALUE).value(dvalue.getValue()); + writer.name("defining_code"); + codePhraseAdapter.write(writer, dvalue.getDefiningCode()); + termMappingAdapter.write(writer, dvalue.getMappings()); + writer.endObject(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateAdapter.java new file mode 100644 index 0000000..b04d9cc --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateAdapter.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.date.DvDateAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class DvDateAdapter extends DvTypeAdapter { + + public DvDateAdapter(AdapterType adapterType) { + super(adapterType); + } + + public DvDateAdapter() {} + + @Override + public DvDate read(JsonReader arg0) { + return null; + } + + @Override + public void write(JsonWriter writer, DvDate dvalue) throws IOException { + if (dvalue == null) { + writer.nullValue(); + return; + } + + DvDateAttributes dvDateAttributes = DvDateAttributes.instanceFromValue(dvalue); + + if (adapterType == I_DvTypeAdapter.AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name(VALUE).value(dvDateAttributes.getValueAsProvided().toString()); + writer.name(EPOCH_OFFSET).value(dvDateAttributes.getTimeStamp()); + writer.endObject(); + } else if (adapterType == I_DvTypeAdapter.AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(dvalue).camelToUpperSnake()); + writer.name(VALUE).value(dvalue.getValue().toString()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateTimeAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateTimeAdapter.java new file mode 100644 index 0000000..e37577b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDateTimeAdapter.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.datetime.DvDateTimeAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class DvDateTimeAdapter extends DvTypeAdapter { + + public DvDateTimeAdapter(AdapterType adapterType) { + super(adapterType); + } + + public DvDateTimeAdapter() {} + + @Override + public DvDateTime read(JsonReader arg0) { + return null; + } + + @Override + public void write(JsonWriter writer, DvDateTime dvalue) throws IOException { + if (dvalue == null || dvalue.getValue() == null) { + writer.nullValue(); + return; + } + + // new encoding + DvDateTimeAttributes dvDateTimeAttributes = DvDateTimeAttributes.instanceFromValue(dvalue); + + if (adapterType == I_DvTypeAdapter.AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name(VALUE).value(dvDateTimeAttributes.getValueAsProvided().toString()); + writer.name(EPOCH_OFFSET).value(dvDateTimeAttributes.getTimeStamp()); + writer.endObject(); + } else if (adapterType == I_DvTypeAdapter.AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(dvalue).camelToUpperSnake()); + writer.name(VALUE).value(dvalue.getValue().toString()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDurationAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDurationAdapter.java new file mode 100644 index 0000000..552ff79 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvDurationAdapter.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * Created by christian on 9/9/2016. + */ +public class DvDurationAdapter extends DvTypeAdapter { + + public DvDurationAdapter(AdapterType adapterType) { + super(adapterType); + } + + public DvDurationAdapter() {} + + @Override + public void write(JsonWriter writer, DvDuration dvDuration) throws IOException { + if (dvDuration == null || dvDuration.getValue() == null) { + writer.nullValue(); + return; + } + + if (adapterType == I_DvTypeAdapter.AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name("value").value(dvDuration.getValue().toString()); + writer.endObject(); + } else if (adapterType == I_DvTypeAdapter.AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(dvDuration).camelToUpperSnake()); + writer.name("value").value(dvDuration.getValue().toString()); + writer.endObject(); + } + } + + @Override + public DvDuration read(JsonReader jsonReader) throws IOException { + return null; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTextAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTextAdapter.java new file mode 100644 index 0000000..8dff747 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTextAdapter.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datavalues.DvText; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class DvTextAdapter extends DvTypeAdapter { + + public DvTextAdapter(AdapterType adapterType) { + super(adapterType); + } + + public DvTextAdapter() {} + + @Override + public DvText read(JsonReader arg0) { + return null; + } + + @Override + public void write(JsonWriter writer, DvText dvalue) throws IOException { + if (dvalue == null) { + writer.nullValue(); + return; + } + + TermMappingAdapter termMappingAdapter = new TermMappingAdapter(adapterType); + if (adapterType == I_DvTypeAdapter.AdapterType.PG_JSONB + || adapterType == I_DvTypeAdapter.AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name("value").value(dvalue.getValue()); + writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(dvalue).camelToUpperSnake()); + termMappingAdapter.write(writer, dvalue.getMappings()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTimeAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTimeAdapter.java new file mode 100644 index 0000000..3322667 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTimeAdapter.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.attributes.datavalues.datetime.time.DvTimeAttributes; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.ObjectSnakeCase; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class DvTimeAdapter extends DvTypeAdapter { + + public DvTimeAdapter(AdapterType adapterType) { + super(adapterType); + } + + public DvTimeAdapter() {} + + @Override + public DvTime read(JsonReader arg0) { + return null; + } + + @Override + public void write(JsonWriter writer, DvTime dvalue) throws IOException { + if (dvalue == null) { + writer.nullValue(); + return; + } + + DvTimeAttributes dvTimeAttributes = DvTimeAttributes.instanceFromValue(dvalue); + + if (adapterType == AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name(VALUE).value(dvTimeAttributes.getValueAsProvided().toString()); + writer.name(EPOCH_OFFSET).value(dvTimeAttributes.getTimeStamp()); + writer.endObject(); + } else if (adapterType == AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new ObjectSnakeCase(dvalue).camelToUpperSnake()); + writer.name(VALUE).value(dvalue.getValue().toString()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTypeAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTypeAdapter.java new file mode 100644 index 0000000..0efb84b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/DvTypeAdapter.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public abstract class DvTypeAdapter extends TypeAdapter implements I_DvTypeAdapter { + + protected AdapterType adapterType; + + protected static final String VALUE = "value"; + protected static final String EPOCH_OFFSET = "epoch_offset"; + + public DvTypeAdapter(AdapterType adapterType) { + super(); + this.adapterType = adapterType; + } + + public DvTypeAdapter() { + super(); + this.adapterType = AdapterType.PG_JSONB; + } + + // @Override + public T read(JsonReader arg0) throws IOException { + return null; + } + + // @Override + public void write(JsonWriter writer, T dvalue) throws IOException {} +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/GenericIdAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/GenericIdAdapter.java new file mode 100644 index 0000000..ad3d1b5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/GenericIdAdapter.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.support.identification.GenericId; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * GSON adapter for GenericId + */ +public class GenericIdAdapter extends DvTypeAdapter { + + public GenericIdAdapter(AdapterType adapterType) { + super(adapterType); + } + + @Override + public GenericId read(JsonReader arg0) throws IOException { + return null; + } + + @Override + public void write(JsonWriter writer, GenericId genericId) throws IOException { + if (genericId == null) { + writer.nullValue(); + return; + } + + if (adapterType == AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name("scheme").value(genericId.getScheme()); + writer.name("value").value(genericId.getValue()); + writer.name(CompositionSerializer.TAG_CLASS).value(GenericId.class.getSimpleName()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/HierObjectIdAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/HierObjectIdAdapter.java new file mode 100644 index 0000000..838338b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/HierObjectIdAdapter.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.support.identification.HierObjectId; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * GSON adapter for HierObjectId + */ +public class HierObjectIdAdapter extends DvTypeAdapter { + + public HierObjectIdAdapter(AdapterType adapterType) { + super(adapterType); + } + + @Override + public HierObjectId read(JsonReader arg0) throws IOException { + return null; + } + + @Override + public void write(JsonWriter writer, HierObjectId hierObjectId) throws IOException { + if (hierObjectId == null) { + writer.nullValue(); + return; + } + + if (adapterType == AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name("value").value(hierObjectId.getValue()); + writer.name(CompositionSerializer.TAG_CLASS).value(HierObjectId.class.getSimpleName()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/ParticipationAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/ParticipationAdapter.java new file mode 100644 index 0000000..a70ccf0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/ParticipationAdapter.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.generic.Participation; +import com.nedap.archie.rm.generic.PartyIdentified; +import java.io.IOException; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class ParticipationAdapter extends DvTypeAdapter { + + public ParticipationAdapter(AdapterType adapterType) { + super(adapterType); + } + + public ParticipationAdapter() {} + + @Override + public Participation read(JsonReader arg0) throws IOException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void write(JsonWriter writer, Participation participation) throws IOException { + if (participation == null) { + writer.nullValue(); + return; + } + + if (adapterType == AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name("function"); + new DvTextAdapter(AdapterType.PG_JSONB).write(writer, participation.getFunction()); + writer.name("mode"); + new DvCodedTextAdapter(AdapterType.PG_JSONB).write(writer, participation.getMode()); + writer.name("performer"); + new PartyIdentifiedAdapter(AdapterType.PG_JSONB) + .write(writer, (PartyIdentified) participation.getPerformer()); + // TODO: add performer and time + writer.endObject(); + } else if (adapterType == AdapterType.RAW_JSON) { + // + // writer.beginObject(); //{ + // writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new + // ObjectSnakeCase(participation).camelToUpperSnake()); + // writer.name("value").value(participation.getValue()); + // CodePhrase codePhrase = participation.getDefiningCode(); + // writer.name("defining_code").value(gson.toJson(codePhrase)); + // writer.endObject(); //} + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyIdentifiedAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyIdentifiedAdapter.java new file mode 100644 index 0000000..c426ccf --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyIdentifiedAdapter.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datatypes.CodePhrase; +import com.nedap.archie.rm.generic.PartyIdentified; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class PartyIdentifiedAdapter extends DvTypeAdapter { + + private Gson gson; + + public PartyIdentifiedAdapter(AdapterType adapterType) { + super(adapterType); + gson = new GsonBuilder() + .registerTypeAdapter(CodePhrase.class, new CodePhraseAdapter(adapterType)) + .setPrettyPrinting() + .create(); + } + + public PartyIdentifiedAdapter() {} + + @Override + public PartyIdentified read(JsonReader arg0) throws IOException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void write(JsonWriter writer, PartyIdentified partyIdentified) throws IOException { + if (partyIdentified == null) { + writer.nullValue(); + return; + } + + if (adapterType == AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name("name").value(partyIdentified.getName()); + writer.name(CompositionSerializer.TAG_CLASS).value(PartyIdentified.class.getSimpleName()); + // TODO: add Identifiers + writer.endObject(); + } else if (adapterType == AdapterType.RAW_JSON) { + // + // writer.beginObject(); //{ + // writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value(new + // ObjectSnakeCase(participation).camelToUpperSnake()); + // writer.name("value").value(participation.getValue()); + // CodePhrase codePhrase = participation.getDefiningCode(); + // writer.name("defining_code").value(gson.toJson(codePhrase)); + // writer.endObject(); //} + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyRefAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyRefAdapter.java new file mode 100644 index 0000000..8ec900a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/PartyRefAdapter.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.support.identification.GenericId; +import com.nedap.archie.rm.support.identification.HierObjectId; +import com.nedap.archie.rm.support.identification.PartyRef; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * GSON adapter for PartyRef + */ +public class PartyRefAdapter extends DvTypeAdapter { + + private final Gson gson; + + public PartyRefAdapter(AdapterType adapterType) { + super(adapterType); + gson = new GsonBuilder() + .registerTypeAdapter(GenericId.class, new GenericIdAdapter(adapterType)) + .setPrettyPrinting() + .create(); + } + + public PartyRefAdapter() { + gson = new GsonBuilder() + .registerTypeAdapter(GenericId.class, new GenericIdAdapter(adapterType)) + .registerTypeAdapter(HierObjectId.class, new HierObjectIdAdapter(adapterType)) + .create(); + } + + @Override + public PartyRef read(JsonReader arg0) throws IOException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void write(JsonWriter writer, PartyRef partyRef) throws IOException { + if (partyRef == null) { + writer.nullValue(); + return; + } + + if (adapterType == AdapterType.PG_JSONB) { + writer.beginObject(); + writer.name("namespace").value(partyRef.getNamespace()); + writer.name("type").value(partyRef.getType()); + writer.name(CompositionSerializer.TAG_CLASS).value(PartyRef.class.getSimpleName()); + if (partyRef.getId() != null) { + writer.name("id").jsonValue(gson.toJson(partyRef.getId())); + } + // TODO: add Identifiers + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TermMappingAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TermMappingAdapter.java new file mode 100644 index 0000000..a29b220 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TermMappingAdapter.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.datavalues.TermMapping; +import java.io.IOException; +import java.util.List; +import org.apache.commons.collections4.CollectionUtils; + +/** + * Created by christian on 4/3/2017. + */ +public class TermMappingAdapter extends DvTypeAdapter { + + private final DvCodedTextAdapter codedTextAdapter; + private final CodePhraseAdapter codePhraseAdapter; + + public TermMappingAdapter(AdapterType adapterType) { + super(adapterType); + codedTextAdapter = new DvCodedTextAdapter(adapterType); + codePhraseAdapter = new CodePhraseAdapter(adapterType); + } + + public void write(JsonWriter writer, List termMappings) throws IOException { + + if (CollectionUtils.isNotEmpty(termMappings)) { + writer.name("mappings"); + writer.beginArray(); // [ + for (TermMapping termMapping : termMappings) { + write(writer, termMapping); + } + writer.endArray(); // + } + } + + @Override + public void write(JsonWriter writer, TermMapping termMapping) throws IOException { + writer.beginObject(); // { + writer.name("_type").value("TERM_MAPPING"); + writer.name("match").value(Character.toString(termMapping.getMatch())); + writer.name("purpose"); + codedTextAdapter.write(writer, termMapping.getPurpose()); + writer.name("target"); + codePhraseAdapter.write(writer, termMapping.getTarget()); + writer.endObject(); // } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TerminologyIDAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TerminologyIDAdapter.java new file mode 100644 index 0000000..e49270d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/TerminologyIDAdapter.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer; + +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.support.identification.TerminologyId; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** + * GSON adapter for DvDateTime + * Required since JSON does not support natively a DateTime data type + */ +public class TerminologyIDAdapter extends DvTypeAdapter { + + public TerminologyIDAdapter(AdapterType adapterType) { + super(adapterType); + } + + public TerminologyIDAdapter() {} + + @Override + public TerminologyId read(JsonReader arg0) throws IOException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void write(JsonWriter writer, TerminologyId terminologyID) throws IOException { + if (terminologyID == null) { + writer.nullValue(); + return; + } + + if (adapterType == AdapterType.PG_JSONB || adapterType == AdapterType.RAW_JSON) { + writer.beginObject(); + writer.name(I_DvTypeAdapter.TAG_CLASS_RAW_JSON).value("TERMINOLOGY_ID"); + writer.name("value").value(terminologyID.getValue()); + writer.endObject(); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchetypeNodeId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchetypeNodeId.java new file mode 100644 index 0000000..e56c23b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchetypeNodeId.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** + * Created by christian on 4/26/2018. + */ +public class ArchetypeNodeId { + + JsonWriter writer; + String archetypeNodeId; + + public ArchetypeNodeId(JsonWriter writer, String nodeIdentifier) { + this.writer = writer; + this.archetypeNodeId = nodeIdentifier; + } + + public void write() throws IOException { + if (archetypeNodeId != null && !archetypeNodeId.isEmpty()) { + writer.name(I_DvTypeAdapter.ARCHETYPE_NODE_ID).value(archetypeNodeId); + + if (new DomainStructure(archetypeNodeId).isArchetypeSlot()) + writer.name(I_DvTypeAdapter.AT_TYPE).value(new DomainStructure(archetypeNodeId).archetypeSlotType()); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchieCompositionProlog.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchieCompositionProlog.java new file mode 100644 index 0000000..ee57d50 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArchieCompositionProlog.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +public class ArchieCompositionProlog { + String compositionRoot; + String compositionName; + + public ArchieCompositionProlog(String compositionRoot, String compositionName) { + this.compositionRoot = compositionRoot; + this.compositionName = compositionName; + } + + public String toString() { + String predicate = new NodeId(compositionRoot).predicate(); + + if (predicate.isEmpty()) return ""; + + String archetypeNodeId = predicate; + + StringBuffer prolog = new StringBuffer(); + prolog.append("{"); + prolog.append("\"archetype_node_id\":") + .append("\"") + .append(archetypeNodeId) + .append("\"") + .append(","); + prolog.append("\"_type\":").append("\"COMPOSITION\"").append(","); + prolog.append("\"name\" : {\n" + " \"_type\" : \"DV_TEXT\",\n" + " \"value\" : ") + .append("\"") + .append(compositionName) + .append("\"") + .append("}") + .append(","); + + return prolog.toString(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayChildren.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayChildren.java new file mode 100644 index 0000000..e1c23a9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayChildren.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import java.util.List; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * Created by christian on 3/12/2018. + */ +public class ArrayChildren { + + List arrayList; + + public ArrayChildren(List value) { + this.arrayList = value; + } + + public boolean hasElement() { + for (Object entry : arrayList) { + if (entry instanceof LinkedTreeMap) { + LinkedTreeMap itemMap = (LinkedTreeMap) entry; + if (itemMap.containsKey(CompositionSerializer.TAG_PATH)) return true; + } + } + return false; + } + + /** + * check if all elements are null + * @return + */ + public boolean isNull() { + for (Object entry : arrayList) { + if (entry != null) return false; + } + return true; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayClosure.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayClosure.java new file mode 100644 index 0000000..d8ad109 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayClosure.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +public class ArrayClosure { + + JsonWriter writer; + private String parentItemsArchetypeNodeId; + private String parentItemsType; + + ArrayClosure(JsonWriter writer, String parentItemsArchetypeNodeId, String parentItemsType) { + this.writer = writer; + this.parentItemsArchetypeNodeId = parentItemsArchetypeNodeId; + this.parentItemsType = parentItemsType; + } + + /** + * close an item array + */ + private void close() throws IOException { + if (parentItemsArchetypeNodeId != null) + writer.name(I_DvTypeAdapter.ARCHETYPE_NODE_ID).value(parentItemsArchetypeNodeId); + if (parentItemsType != null) writer.name(I_DvTypeAdapter.AT_CLASS).value(parentItemsType); + } + + public void start() throws IOException { + close(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListAdapter.java new file mode 100644 index 0000000..922e73d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListAdapter.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.TypeAdapter; +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** + * GSON adapter for ArrayList + */ +public class ArrayListAdapter extends TypeAdapter implements I_DvTypeAdapter { + + protected AdapterType adapterType = AdapterType._DBJSON2RAWJSON; + // protected String archetypeNodeId = null; + // protected String key = null; + + public ArrayListAdapter(AdapterType adapterType) { + super(); + this.adapterType = adapterType; + } + + public ArrayListAdapter() { + super(); + this.adapterType = AdapterType._DBJSON2RAWJSON; + } + + // @Override + public ArrayList read(JsonReader arg0) throws IOException { + // TODO Auto-generated method stub + return null; + } + + // @Override + public void write(JsonWriter writer, ArrayList arrayList) throws IOException { + + // System.out.println("begin array -----------------------------"); + for (Object entry : arrayList) { + if (entry instanceof LinkedTreeMap) { + LinkedTreeMap itemMap = (LinkedTreeMap) entry; + // String path = new PathAttribute().findPath(itemMap); + new LinkedTreeMapAdapter().write(writer, itemMap); + } else throw new IllegalArgumentException("unhandled item in array:" + entry); + } + + // System.out.println("end array -----------------------------"); + + return; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListPeek.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListPeek.java new file mode 100644 index 0000000..7d882ca --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ArrayListPeek.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import java.util.ArrayList; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +public class ArrayListPeek { + + ArrayList arrayList; + + public ArrayListPeek(ArrayList arrayList) { + this.arrayList = arrayList; + } + + public String findClass() { + + String classInArray = null; + + for (Object map : arrayList) { + + if (map instanceof LinkedTreeMap) { + if (((LinkedTreeMap) map).containsKey(CompositionSerializer.TAG_CLASS)) { + // writeNameAsValue(writer, (ArrayList) value); + Object classValue = (((LinkedTreeMap) map).get(CompositionSerializer.TAG_CLASS)); + if (classValue instanceof String) classInArray = (String) classValue; + else if (classValue instanceof ArrayList) classInArray = (String) ((ArrayList) classValue).get(0); + else throw new IllegalArgumentException("Could not handle class tag in array"); + } + } + } + + return classInArray; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Children.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Children.java new file mode 100644 index 0000000..e4697ce --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Children.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** Created by christian on 3/13/2018. */ +public class Children { + + LinkedTreeMap linkedTreeMap; + + public Children(LinkedTreeMap linkedTreeMap) { + this.linkedTreeMap = linkedTreeMap; + } + + public boolean isItemsOnly() { + + if (linkedTreeMap.keySet().stream() + .filter(s -> s.startsWith(CompositionSerializer.TAG_ITEMS)) + .collect(Collectors.toSet()) + .size() + == 0) return false; + + for (String key : linkedTreeMap.keySet()) { + if (!key.startsWith(CompositionSerializer.TAG_ITEMS) + && !key.equals(I_DvTypeAdapter.ARCHETYPE_NODE_ID) + && !key.equals(I_DvTypeAdapter.AT_CLASS) + && !isTrivialLocatableAttribute(key) + && !key.equals(CompositionSerializer.TAG_CLASS)) { + return false; + } + } + return true; + } + + private static boolean isTrivialLocatableAttribute(String key) { + return (key.equals(CompositionSerializer.TAG_ARCHETYPE_NODE_ID) + || key.equals(CompositionSerializer.TAG_ARCHETYPE_DETAILS) + || key.equals(CompositionSerializer.TAG_NAME)); + } + + public int itemsCount() { + int count = 0; + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_ITEMS)) count++; + } + return count; + } + + public int eventsCount() { + int count = 0; + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_EVENTS)) count++; + } + return count; + } + + // check for multiple items in content + public boolean isMultiContent() { + + if (!containsKeyStartingWith(CompositionSerializer.TAG_CONTENT)) return false; + + int contents = 0; + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_CONTENT)) { + contents++; + } + } + return contents > 1; + } + + public int contentCount() { + int contents = 0; + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_CONTENT)) { + contents++; + } + } + return contents; + } + + public boolean isMultiData() { + int data = 0; + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_DATA)) { + data++; + } + } + return data > 1; + } + + public boolean isEvents() { + if (linkedTreeMap.keySet().stream() + .filter(s -> s.startsWith(CompositionSerializer.TAG_EVENTS)) + .collect(Collectors.toSet()) + .size() + == 0) return false; + + int isEvents = 0; + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_EVENTS)) { + isEvents++; + } + } + return isEvents > 1; + } + + public String type() { + + if (linkedTreeMap.containsKey(CompositionSerializer.TAG_CLASS)) { + return (String) linkedTreeMap.get(CompositionSerializer.TAG_CLASS); + } + + return "*UNDEF*"; + } + + public ArrayList items() { + + ArrayList items = new ArrayList(); + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_ITEMS)) { + String archetypeNodeId = new NodeId(key).predicate(); + Object e = linkedTreeMap.get(key); + if (List.class.isAssignableFrom(e.getClass())) { + ((List) e) + .stream() + .filter(o -> Map.class.isAssignableFrom(o.getClass())) + .forEach(m -> ((Map) m).put(I_DvTypeAdapter.ARCHETYPE_NODE_ID, archetypeNodeId)); + } else if (Map.class.isAssignableFrom(e.getClass())) { + ((Map) e).put(I_DvTypeAdapter.ARCHETYPE_NODE_ID, archetypeNodeId); + } + items.add(e); + } + } + + return items; + } + + public ArrayList events() { + + ArrayList events = new ArrayList(); + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_EVENTS)) events.add(linkedTreeMap.get(key)); + } + + return events; + } + + public ArrayList contents() { + ArrayList contents = new ArrayList(); + + for (String key : linkedTreeMap.keySet()) { + if (key.startsWith(CompositionSerializer.TAG_CONTENT)) contents.add(linkedTreeMap.get(key)); + } + + return contents; + } + + public LinkedTreeMap removeContents() { + LinkedTreeMap retMap = new LinkedTreeMap(); + for (String key : linkedTreeMap.keySet()) { + if (!key.startsWith(CompositionSerializer.TAG_CONTENT)) retMap.put(key, linkedTreeMap.get(key)); + } + return retMap; + } + + public LinkedTreeMap removeDuplicateArchetypeNodeId() { + LinkedTreeMap retMap = new LinkedTreeMap(); + retMap.putAll(linkedTreeMap); + if (linkedTreeMap.containsKey(I_DvTypeAdapter.ARCHETYPE_NODE_ID) + && linkedTreeMap.containsKey(CompositionSerializer.TAG_ARCHETYPE_NODE_ID)) + retMap.remove(CompositionSerializer.TAG_ARCHETYPE_NODE_ID); + return retMap; + } + + private boolean containsKeyStartingWith(String key) { + return linkedTreeMap.keySet().stream() + .filter(s -> s.startsWith(key)) + .collect(Collectors.toSet()) + .size() + > 0; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/CompositionRoot.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/CompositionRoot.java new file mode 100644 index 0000000..bc711a9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/CompositionRoot.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +public class CompositionRoot { + String dbEncoded; + + public CompositionRoot(String dbEncoded) { + this.dbEncoded = dbEncoded; + } + + public String toString() { + + if (!dbEncoded.contains("/composition")) return ""; + + int beginIndex = dbEncoded.indexOf("/composition"); + int endIndex = dbEncoded.indexOf("]", beginIndex) + 1; + return dbEncoded.substring(beginIndex, endIndex).replace("\\u003d", "=").replace("\\u0027", "'"); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DomainStructure.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DomainStructure.java new file mode 100644 index 0000000..a03a674 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DomainStructure.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.openehr.sdk.util.rmconstants.RmConstants; + +/** + * Created by christian on 4/26/2018. + */ +public class DomainStructure { + + public static final String OPEN_EHR_EHR = "openEHR-EHR-"; + String nodeIdentifier; + + public DomainStructure(String nodeIdentifier) { + this.nodeIdentifier = nodeIdentifier; + } + + /** + * is it a composition structure element? + * + * @return + */ + public boolean isArchetypeSlot() { + return nodeIdentifier.contains(OPEN_EHR_EHR); + } + + public String archetypeSlotType() { + + String type = "*UNDEF*"; + + if (nodeIdentifier.equals(CompositionSerializer.TAG_EVENTS)) type = RmConstants.POINT_EVENT; + else if (nodeIdentifier.equals(CompositionSerializer.TAG_ACTIVITIES)) type = "ACTIVITY"; + else if (nodeIdentifier.contains(OPEN_EHR_EHR)) + type = nodeIdentifier.substring(OPEN_EHR_EHR.length(), nodeIdentifier.indexOf(".")); + + return type; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvCodedTextNameValue.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvCodedTextNameValue.java new file mode 100644 index 0000000..6d7615b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvCodedTextNameValue.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.rmconstants.RmConstants; + +public class DvCodedTextNameValue implements I_NameValueHandler { + + private final JsonWriter writer; + private final String value; + private final List mappings; + private String codeString; + private String terminologyId; + private String preferredTerm; + + DvCodedTextNameValue(JsonWriter writer, LinkedTreeMap value) { + this.writer = writer; + this.value = value.get("value").toString(); + this.mappings = (List) value.get("mappings"); + if (value.get("defining_code") != null) { + this.codeString = + ((Map) value.get("defining_code")).get("code_string").toString(); + this.terminologyId = ((Map) ((Map) value.get("defining_code")).get("terminology_id")) + .get("value") + .toString(); + this.preferredTerm = Optional.of(value) + .map(v -> v.get("defining_code")) + .map(Map.class::cast) + .map(m -> m.get("preferred_term")) + .map(Object::toString) + .orElse(null); + } + } + + /** + * Encode a name value into the DB json structure + * + * "name": { + * "value":... + * } + * + * @throws IOException + */ + @Override + public void write() throws IOException { + if (value == null || value.isEmpty()) return; + writer.name(I_DvTypeAdapter.NAME); + writer.beginObject(); + writer.name(I_DvTypeAdapter.VALUE).value(value); + if (mappings != null) { + DvTextNameValue.writeTermMappingList(writer, mappings); + } + + if (codeString != null) { + writer.name(I_DvTypeAdapter.AT_TYPE).value(RmConstants.DV_CODED_TEXT); + writer.name("defining_code"); + + writer.beginObject(); + writer.name("code_string").value(codeString); + + writer.name("terminology_id") + .beginObject() + .name("value") + .value(terminologyId) + .endObject(); + if (preferredTerm != null) { + writer.name("preferred_term").value(preferredTerm); + } + writer.endObject(); + } else writer.name(I_DvTypeAdapter.AT_TYPE).value(RmConstants.DV_TEXT); + + writer.endObject(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvTextNameValue.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvTextNameValue.java new file mode 100644 index 0000000..9127bbc --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/DvTextNameValue.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.util.rmconstants.RmConstants; + +public class DvTextNameValue implements I_NameValueHandler { + + private final JsonWriter writer; + private final String value; + private List mappings; + + DvTextNameValue(JsonWriter writer, String value) { + this.writer = writer; + this.value = value; + } + + DvTextNameValue(JsonWriter writer, LinkedTreeMap value) { + this.writer = writer; + this.value = value.get("value").toString(); + this.mappings = (List) value.get("mappings"); + } + + /** + * Encode a name value into the DB json structure + * + * "name": { + * "value":... + * } + * + * @throws IOException + */ + @Override + public void write() throws IOException { + if (value == null || value.isEmpty()) return; + writer.name(I_DvTypeAdapter.NAME); + writer.beginObject(); + writer.name(I_DvTypeAdapter.VALUE).value(value); + if (mappings != null) { + writeTermMappingList(writer, mappings); + } + writer.name(I_DvTypeAdapter.AT_TYPE).value(RmConstants.DV_TEXT); + writer.endObject(); + } + + public static void writeTermMappingList(JsonWriter w, List list) throws IOException { + w.name("mappings"); + w.beginArray(); + for (Object o : list) { + writeValue(w, o); + } + w.endArray(); + } + + private static void writeMap(JsonWriter w, Map map) throws IOException { + w.beginObject(); + for (Object e : map.keySet()) { + Object value = map.get(e); + w.name((String) e); + writeValue(w, value); + } + w.endObject(); + } + + private static void writeValue(JsonWriter w, Object value) throws IOException { + if (value instanceof List l) { + w.beginArray(); + for (Object o : l) { + writeValue(w, o); + } + w.endArray(); + } else if (value instanceof Map m) { + writeMap(w, m); + } else { + w.value(Optional.ofNullable(value).map(Object::toString).orElse(null)); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ElementType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ElementType.java new file mode 100644 index 0000000..a158515 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ElementType.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import java.util.List; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +public class ElementType { + + Map valueMap; + + public ElementType(Map valueMap) { + this.valueMap = valueMap; + } + + public String type() { + String elementType = null; + + if (valueMap.get(CompositionSerializer.TAG_CLASS) instanceof String) { + elementType = (String) valueMap.get(CompositionSerializer.TAG_CLASS); + } else if (valueMap.get(CompositionSerializer.TAG_CLASS) instanceof List) { + elementType = (String) ((List) valueMap.get(CompositionSerializer.TAG_CLASS)).get(0); + } else elementType = "*UNDEF*"; + + return elementType; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/EmbeddedValue.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/EmbeddedValue.java new file mode 100644 index 0000000..8093fbe --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/EmbeddedValue.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * restructure special items containing a "value" key for canonical representation + */ +class EmbeddedValue { + private LinkedTreeMap valueMap; + + private String[] embeddedTags = { + CompositionSerializer.TAG_NARRATIVE, + CompositionSerializer.TAG_MATH_FUNCTION, + CompositionSerializer.TAG_WIDTH, + CompositionSerializer.TAG_UID + }; + + EmbeddedValue(LinkedTreeMap valueMap) { + this.valueMap = valueMap; + } + + private LinkedTreeMap formatForTag(String tag) { + + if (valueMap.containsKey(tag)) { + LinkedTreeMap treeMap = (LinkedTreeMap) valueMap.get(tag); + // get the value + if (!(treeMap.get(CompositionSerializer.TAG_VALUE) instanceof String)) { + LinkedTreeMap treeMapValue = (LinkedTreeMap) treeMap.get(CompositionSerializer.TAG_VALUE); + if (treeMapValue != null) treeMap.replace(CompositionSerializer.TAG_VALUE, treeMapValue.get("value")); + } + } + + return valueMap; + } + + LinkedTreeMap formatForEmbeddedTag() { + for (String tag : embeddedTags) { + if (valueMap.containsKey(tag)) valueMap = formatForTag(tag); + } + return valueMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/GenericRmType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/GenericRmType.java new file mode 100644 index 0000000..6908a6a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/GenericRmType.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** + * Deals with specialization of DataValues (f.e. DV_INTERVAL) + */ +public class GenericRmType { + + private String type; + + public GenericRmType(String type) { + this.type = type; + } + + /** + * check if type is specialized + * + * @return true if the type is specialized + */ + public boolean isSpecialized() { + return type.contains("<") && type.contains(">"); + } + + /** + * identify main RmType (f.e. DV_INTERVAL) + * + * @return the main type + */ + public String mainType() { + if (!isSpecialized()) return type; + return type.substring(0, type.indexOf("<")); + } + + /** + * identify the RmType used to specialized the type + * f.e. DV_QUANTITY in DV_INTERVAL + * + * @return the specialized type or null + */ + public String specializedWith() { + if (!isSpecialized()) return null; + + return type.substring(type.indexOf("<") + 1, type.indexOf(">")); + } + + /** + * add the type in each datavalues for this instance. + * F.e. add the _type for lower and upper in an interval + * + * @param valueMap the built valueMap for canonical json encoding + * @return the updated valueMap + */ + @SuppressWarnings("java:S2864") + LinkedTreeMap inferSpecialization(LinkedTreeMap valueMap) { + + if (!isSpecialized()) // do nothing + return valueMap; + + for (String key : valueMap.keySet()) { + Object entry = valueMap.get(key); + // entry is either a Map or an Array + if (entry instanceof Map) { + // add the type + ((Map) entry).put(I_DvTypeAdapter.TAG_CLASS_RAW_JSON, specializedWith()); + } + } + + // remove the specialization for canonical rendering + String valueType = (String) valueMap.get(I_DvTypeAdapter.TAG_CLASS_RAW_JSON); + valueMap.put(I_DvTypeAdapter.TAG_CLASS_RAW_JSON, valueType.split("<")[0]); + + return valueMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/I_NameValueHandler.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/I_NameValueHandler.java new file mode 100644 index 0000000..e7c890d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/I_NameValueHandler.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import java.io.IOException; + +public interface I_NameValueHandler { + + public void write() throws IOException; +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/IterativeItemStructure.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/IterativeItemStructure.java new file mode 100644 index 0000000..bb5cd64 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/IterativeItemStructure.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import java.util.Map; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * deals with representation issues required to support AQL at DB level but causing wrong structuration when + * returning canonical json. For example + * + * /events: { + * /events[at0002]: [ + * ... + * ] + * } + * + *

+ * Should be return as: + * + * + * {"events":[...,"archetype_node_id":"at0002"}]} + * + *

+ * The same logic applies to ACTIVITIES + */ +class IterativeItemStructure { + + private LinkedTreeMap valueMap; + + private String[] iterativeTags = {CompositionSerializer.TAG_ACTIVITIES, CompositionSerializer.TAG_EVENTS}; + + IterativeItemStructure(LinkedTreeMap valueMap) { + this.valueMap = valueMap; + } + + LinkedTreeMap promoteIterations() { + for (String iterativeTag : iterativeTags) { + if (valueMap.containsKey(iterativeTag)) { + LinkedTreeMap activities = (LinkedTreeMap) valueMap.get(iterativeTag); + for (Map.Entry activityItem : activities.entrySet()) { + if (activityItem.getKey().startsWith(iterativeTag)) { + valueMap.put(activityItem.getKey(), activityItem.getValue()); + } + } + valueMap.remove(iterativeTag); + } + } + return valueMap; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/LinkedTreeMapAdapter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/LinkedTreeMapAdapter.java new file mode 100644 index 0000000..1c02f41 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/LinkedTreeMapAdapter.java @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.TypeAdapter; +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia; +import com.nedap.archie.rminfo.ArchieRMInfoLookup; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; +import org.ehrbase.openehr.sdk.aql.webtemplatepath.AqlPath; +import org.ehrbase.openehr.sdk.util.SnakeCase; + +/** + * GSON adapter for LinkedTreeMap + * + *

NB. @SuppressWarnings("unchecked") is used to deal with generics + */ +public class LinkedTreeMapAdapter extends TypeAdapter> implements I_DvTypeAdapter { + + private static final Set STRUCTURAL_CLASSES = Set.of( + "ItemTree", + "ItemTable", + "ItemSingle", + "PointEvent", + "Instruction", + "Evaluation", + "Observation", + "Action", + "AdminEntry", + "IntervalEvent"); + + protected AdapterType adapterType; + + public LinkedTreeMapAdapter(AdapterType adapterType) { + super(); + this.adapterType = adapterType; + } + + public LinkedTreeMapAdapter() { + super(); + this.adapterType = AdapterType.DBJSON2RAWJSON; + } + + // @Override + public LinkedTreeMap read(JsonReader arg0) { + return null; + } + + @SuppressWarnings("unchecked") + private void writeInternal(JsonWriter writer, LinkedTreeMap map) throws IOException { + + map = new Children(map).removeDuplicateArchetypeNodeId(); + + boolean isItemsOnly = new Children(map).isItemsOnly(); + boolean isMultiEvents = new Children(map).isEvents(); + boolean isMultiContent = new Children(map).isMultiContent(); + + fixWrongDbEncoding(map); + + String parentItemsArchetypeNodeId = null; + String parentItemsType = null; + + if (isItemsOnly || isMultiEvents) { + // promote archetype node id and type at parent level + // get the archetype node id + if (map.containsKey(I_DvTypeAdapter.ARCHETYPE_NODE_ID)) { + parentItemsArchetypeNodeId = (String) map.get(I_DvTypeAdapter.ARCHETYPE_NODE_ID); + map.remove(I_DvTypeAdapter.ARCHETYPE_NODE_ID); + } + if (map.containsKey(AT_TYPE)) { + parentItemsType = (String) map.get(AT_TYPE); + map.remove(AT_TYPE); + } + if (map.containsKey(CompositionSerializer.TAG_CLASS)) { + if (map.get(CompositionSerializer.TAG_CLASS) instanceof ArrayList) + parentItemsType = new SnakeCase( + (String) ((ArrayList) map.get(CompositionSerializer.TAG_CLASS)).get(0)) + .camelToUpperSnake(); + else if (map.get(CompositionSerializer.TAG_CLASS) instanceof String) + parentItemsType = + new SnakeCase((String) map.get(CompositionSerializer.TAG_CLASS)).camelToUpperSnake(); + + map.remove(CompositionSerializer.TAG_CLASS); + } + } + + if (isItemsOnly) { + // CHC 20191003: Removed archetype_node_id writer since it is serviced by closing the array. + ArrayList items = new Children(map).items(); + + if (map.containsKey(CompositionSerializer.TAG_NAME)) { + if (map.get(CompositionSerializer.TAG_NAME) instanceof ArrayList) + new ValueArrayList(writer, map.get(CompositionSerializer.TAG_NAME), CompositionSerializer.TAG_NAME) + .write(); + else if (map.get(CompositionSerializer.TAG_NAME) instanceof String) + new NameValue(writer, (String) map.get(CompositionSerializer.TAG_NAME)).write(); + else if (map.get(CompositionSerializer.TAG_NAME) instanceof LinkedTreeMap) { + new NameValue(writer, (LinkedTreeMap) map.get(CompositionSerializer.TAG_NAME)).write(); + } + } + + if (map.containsKey(CompositionSerializer.TAG_ARCHETYPE_NODE_ID)) { + if (map.get(CompositionSerializer.TAG_ARCHETYPE_NODE_ID) instanceof ArrayList) + new ValueArrayList( + writer, + map.get(CompositionSerializer.TAG_ARCHETYPE_NODE_ID), + CompositionSerializer.TAG_ARCHETYPE_NODE_ID) + .write(); + else + writer.name(ARCHETYPE_NODE_ID) + .value(map.get(CompositionSerializer.TAG_ARCHETYPE_NODE_ID) + .toString()); + } + + writeItemInArray(ITEMS, items, writer, parentItemsArchetypeNodeId, parentItemsType); + } else if (isMultiEvents) { + // assumed sorted (LinkedTreeMap preserve input order) + ArrayList events = new Children(map).events(); + writeItemInArray(EVENTS, events, writer, parentItemsArchetypeNodeId, parentItemsType); + } else if (isMultiContent) { + while (map.keySet().iterator().hasNext()) { + String key = map.keySet().iterator().next(); + if (!key.startsWith(CompositionSerializer.TAG_CONTENT)) { + if (map.get(key) instanceof LinkedTreeMap) { + writer.name(key); + writer.beginObject(); + writeNode((LinkedTreeMap) map.get(key), writer); + writer.endObject(); + } else if (map.get(key) instanceof ArrayList) { // due to using multimap + if (!key.equals(CompositionSerializer.TAG_CLASS)) { // ignore it + ArrayList arrayList = (ArrayList) map.get(key); + if (!arrayList.isEmpty()) + writer.name(key).value(arrayList.get(0).toString()); + } + } else writer.name(key).value((String) map.get(key)); + map.remove(key); + } else { + if (isNodePredicate(key)) { + // set the archetype node id in each children + for (Map.Entry kv : map.entrySet()) { + for (Object valueMap : (ArrayList) kv.getValue()) { + if (valueMap instanceof LinkedTreeMap) { + LinkedTreeMap vm = (LinkedTreeMap) valueMap; + vm.put( + CompositionSerializer.TAG_ARCHETYPE_NODE_ID, + AqlPath.parse(kv.getKey()) + .getLastNode() + .getAtCode()); + } + } + } + } + Children children = new Children(map); + ArrayList contents = children.contents(); + writeContent(contents, writer); + map = children.removeContents(); + } + if (map.size() == 1) { + if (map.get(CompositionSerializer.TAG_CLASS) != null) // the only remaining key is CLASS + { + return; + } else + throw new IllegalStateException("Inconsistent encoding of composition, found:" + map.keySet()); + } + } + } else { + writeNode(map, writer); + } + } + + /** + * fix worryingly encoded {@link com.nedap.archie.rm.archetyped.Locatable} attributes {@link + * Locatable#getLinks()}, {@link Locatable#getUid()} and {@link Locatable#getFeederAudit()} with + * extra [] + * + * @param map + */ + private void fixWrongDbEncoding(LinkedTreeMap map) { + if (map.containsKey(CompositionSerializer.TAG_UID) + && map.get(CompositionSerializer.TAG_UID) instanceof List + && !((List) map.get(CompositionSerializer.TAG_UID)).isEmpty()) { + map.put(CompositionSerializer.TAG_UID, ((List) map.get(CompositionSerializer.TAG_UID)).get(0)); + } + + if (map.containsKey(CompositionSerializer.TAG_FEEDER_AUDIT) + && map.get(CompositionSerializer.TAG_FEEDER_AUDIT) instanceof List + && !((List) map.get(CompositionSerializer.TAG_FEEDER_AUDIT)).isEmpty()) { + map.put( + CompositionSerializer.TAG_FEEDER_AUDIT, + ((List) map.get(CompositionSerializer.TAG_FEEDER_AUDIT)).get(0)); + } + + if (map.containsKey(CompositionSerializer.TAG_LINKS) + && map.get(CompositionSerializer.TAG_LINKS) instanceof List + && !((List) map.get(CompositionSerializer.TAG_LINKS)).isEmpty() + && ((List) map.get(CompositionSerializer.TAG_LINKS)).get(0) instanceof List) { + map.put(CompositionSerializer.TAG_LINKS, ((List) map.get(CompositionSerializer.TAG_LINKS)).get(0)); + } + } + + @SuppressWarnings("unchecked") + private LinkedTreeMap reformatMapForCanonical(LinkedTreeMap map) { + map = new IterativeItemStructure(map).promoteIterations(); + map = new EmbeddedValue(map).formatForEmbeddedTag(); + return map; + } + + // @Override + @SuppressWarnings("unchecked") + public void write(JsonWriter writer, LinkedTreeMap map) throws IOException { + if (map.isEmpty()) { + writer.nullValue(); + return; + } + writer.beginObject(); + writeInternal(writer, map); + writer.endObject(); + } + + private boolean isNodePredicate(String key) { + // a key in the form '/xyz[atNNNN]' + return key.startsWith("/") && key.contains("[") && key.contains("]"); + } + + @SuppressWarnings("unchecked") + private LinkedTreeMap compactTimeMap(LinkedTreeMap valueMap) { + LinkedTreeMap compactMap = new LinkedTreeMap<>(); + for (Map.Entry item : valueMap.entrySet()) { + String key = item.getKey(); + if (key.equals(CompositionSerializer.TAG_VALUE)) { + String value = (String) ((LinkedTreeMap) (item).getValue()).get("value"); + compactMap.put(CompositionSerializer.TAG_VALUE, value); + } else { + compactMap.put(item.getKey(), item.getValue()); + } + } + return compactMap; + } + + /** + * this method perform a factorization of items as an array. When serialized, items are presented + * as an array list in the form:
+ * + * /items[openEHR-EHR-...] { item 1 } + * /items[openEHR-EHR-...] { item 2 } + * ... + *
+ * The expected result is + * /items : { item 1 }{item 2} + * with the node predicate passed as archetype node id inside its respective item content + * + * @param heading String the heading of this node (f.e. 'items') + * @param value ArrayList the content of this node as a list of json structures + * @param writer {@link JsonWriter} the writer used to create the json translation + * @param parentItemsArchetypeNodeId String the id of the parent node + * @param parentItemsType String the type of the parent node (f.e. SECTION) + * @throws IOException whenever a json writing issue occurs + */ + private void writeItemInArray( + String heading, + ArrayList value, + JsonWriter writer, + String parentItemsArchetypeNodeId, + String parentItemsType) + throws IOException { + new ArrayClosure(writer, parentItemsArchetypeNodeId, parentItemsType).start(); + if (value.isEmpty()) { + return; + } + for (int cursor = 0; cursor < value.size(); cursor++) { + if (cursor == 0) { // initial + writer.name(heading); // header of items list + writer.beginArray(); + } + if (value.get(cursor) instanceof ArrayList) { + new ArrayListAdapter().write(writer, (ArrayList) value.get(cursor)); + } else { // next siblings + new LinkedTreeMapAdapter().write(writer, (LinkedTreeMap) value.get(cursor)); + } + } + writer.endArray(); + } + + private void writeContent(ArrayList value, JsonWriter writer) throws IOException { + + for (int cursor = 0; cursor < value.size(); cursor++) { + if (cursor == 0) { // initial + // insert archetype node id + writer.name("content"); + writer.beginArray(); + } + if (value.get(cursor) instanceof ArrayList) + new ArrayListAdapter().write(writer, (ArrayList) value.get(cursor)); + else new LinkedTreeMapAdapter().write(writer, (LinkedTreeMap) value.get(cursor)); + } + writer.endArray(); + } + + @SuppressWarnings("unchecked") + private void writeNode(LinkedTreeMap map, JsonWriter writer) throws IOException { + + // some hacking for some specific entries... + reformatMapForCanonical(map); + + for (Map.Entry entry : map.entrySet()) { + Object value = entry.getValue(); + + if (value == null) continue; + + String key = entry.getKey(); + + if (new OptOut(key).skipIt()) continue; + + String jsonKey = new RawJsonKey(key).toRawJson(); + final String archetypeNodeId = new NodeId(key).predicate(); + + // required to deal with DV_MULTIMEDIA embedded document in data + if (value instanceof ArrayList + && key.equals("data") + && map.get("_type") + .equals(ArchieRMInfoLookup.getInstance() + .getTypeInfo(DvMultimedia.class) + .getRmName())) { + // prepare a store for the value + Double[] dataStore = new Double[((ArrayList) value).size()]; + value = ((ArrayList) value).toArray(dataStore); + } + + if (value instanceof ArrayList) { + if (key.equals(CompositionSerializer.TAG_NAME)) { + new ValueArrayList(writer, value, key).write(); + } else if (key.equals(CompositionSerializer.TAG_CLASS)) { + writer.name(AT_TYPE) + .value(new SnakeCase((String) ((ArrayList) value).get(0)).camelToUpperSnake()); + } else if (key.equals(CompositionSerializer.TAG_ARCHETYPE_NODE_ID)) { + // same as name above, this is due to usage of MultiValueMap which is backed by ArrayList + new ValueArrayList(writer, value, key).write(); + } else { + // make sure we service a non empty array list value + if (!new ArrayChildren((ArrayList) value).isNull()) { + writer.name(jsonKey); + writer.beginArray(); + if (isNodePredicate(key)) { + ((ArrayList) value) + .stream() + .filter(o -> Map.class.isAssignableFrom(o.getClass())) + .forEach(m -> ((Map) m) + .put(I_DvTypeAdapter.ARCHETYPE_NODE_ID, archetypeNodeId)); + } + new ArrayListAdapter().write(writer, (ArrayList) value); + writer.endArray(); + } + } + } else if (value instanceof LinkedTreeMap) { + LinkedTreeMap valueMap = (LinkedTreeMap) value; + String elementType = new ElementType(valueMap).type(); + + if (elementType.equals("History")) { + // promote events[...] + LinkedTreeMap eventMap = + (LinkedTreeMap) valueMap.get(CompositionSerializer.TAG_EVENTS); + valueMap.remove(CompositionSerializer.TAG_EVENTS); + valueMap.putAll(eventMap); + valueMap.put(AT_TYPE, new SnakeCase(elementType).camelToUpperSnake()); + } else if (archetypeNodeId.equals(CompositionSerializer.TAG_TIMING) + && elementType.equals("DvParsable")) { + // promote value and formalism + LinkedTreeMap timingValueMap = + (LinkedTreeMap) valueMap.get(CompositionSerializer.TAG_VALUE); + if (timingValueMap != null) { + valueMap.put(CompositionSerializer.TAG_VALUE, timingValueMap.get("value")); + valueMap.put("/formalism", timingValueMap.get("formalism")); + } + } + + if (key.equals(CompositionSerializer.TAG_VALUE)) { + // get the class and add it to the value map + String type = (String) map.get(CompositionSerializer.TAG_CLASS); + if (type != null && !type.isEmpty()) { + // pushed into the value map for the next recursion + valueMap.put(AT_TYPE, new SnakeCase(type).camelToUpperSnake()); + // check if this type is composite (DV_INTERVAL) to push the actual type down + // the value structure + if (new GenericRmType(type).isSpecialized()) { // composite + valueMap = new GenericRmType(new SnakeCase(type).camelToUpperSnake()) + .inferSpecialization(valueMap); + } + } + } + // get the value point type and add it to the value map + if (valueMap.containsKey(CompositionSerializer.TAG_CLASS)) { + valueMap.put(AT_TYPE, new SnakeCase(elementType).camelToUpperSnake()); + valueMap.remove(CompositionSerializer.TAG_CLASS); + if (key.contains("/time")) { + valueMap.remove(CompositionSerializer.TAG_NAME); + } + } + if (isNodePredicate(key)) // contains an archetype node predicate + { + valueMap.put(ARCHETYPE_NODE_ID, archetypeNodeId); + } else if (key.equals(CompositionSerializer.TAG_ORIGIN) || key.equals(CompositionSerializer.TAG_TIME)) { + // compact time expression + valueMap = compactTimeMap(valueMap); + } + writer.name(jsonKey); + new LinkedTreeMapAdapter().write(writer, valueMap); + } else if (value instanceof String) { + switch (key) { + case CompositionSerializer.TAG_CLASS: + if (STRUCTURAL_CLASSES.contains(value)) + writer.name(AT_TYPE).value(new SnakeCase(((String) value)).camelToUpperSnake()); + break; + case CompositionSerializer.TAG_PATH: // this is an element + String archetypeNodeId2 = + AqlPath.parse((String) value).getLastNode().getAtCode(); + if (archetypeNodeId2 != null) writer.name(AT_TYPE).value(ELEMENT); + // CHC 20191003: removed writer for archetype_node_id as it was not applicable here + break; + case CompositionSerializer.TAG_NAME: + new NameValue(writer, value.toString()).write(); + break; + default: + writer.name(jsonKey).value((String) value); + break; + } + } else if (value instanceof Double) { + writer.name(new SnakeCase(key).camelToSnake()).value((Double) value); + } else if (value instanceof Long) { + writer.name(new SnakeCase(key).camelToSnake()).value((Long) value); + } else if (value instanceof Number) { + writer.name(new SnakeCase(key).camelToSnake()).value((Number) value); + } else if (value instanceof Boolean) { + writer.name(new SnakeCase(key).camelToSnake()).value((Boolean) value); + } else if (value instanceof Double[]) { + writer.name(new SnakeCase(key).camelToSnake()); + writer.beginArray(); + for (Double pix : (Double[]) value) { + writer.value(pix.byteValue()); + } + writer.endArray(); + } else + throw new IllegalArgumentException("Could not handle value type for key:" + key + ", value:" + value); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NameValue.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NameValue.java new file mode 100644 index 0000000..81b7406 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NameValue.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +public class NameValue { + + private final I_NameValueHandler handler; + + NameValue(JsonWriter writer, String value) { + this.handler = new DvTextNameValue(writer, value); + } + + NameValue(JsonWriter writer, LinkedTreeMap value) { + if (value.containsKey("defining_code")) { + this.handler = new DvCodedTextNameValue(writer, value); + } else this.handler = new DvTextNameValue(writer, value); + } + + /** + * Encode a name value into the DB json structure + * + * "name": { + * "value":... + * } + * + * @throws IOException + */ + public void write() throws IOException { + handler.write(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NodeId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NodeId.java new file mode 100644 index 0000000..2f8cd67 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/NodeId.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +/** + * Created by christian on 6/22/2017. + */ +public class NodeId { + + String key; + + public NodeId(String theKey) { + this.key = theKey; + } + + public String predicate() { + int closingIndex = key.length(); + if (key.contains(" and name/value")) closingIndex = key.indexOf(" and name/value"); + else if (key.contains("]")) closingIndex = key.indexOf("]"); + + if (key.contains("[") && key.contains("]")) return key.substring(key.indexOf("[") + 1, closingIndex); + return key; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/OptOut.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/OptOut.java new file mode 100644 index 0000000..e8a94c2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/OptOut.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import java.util.Arrays; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; + +/** + * deals with opt-out attributes (f.e. epoch_offset) + */ +public class OptOut { + + private final String tag; + private String[] optOutTag = {CompositionSerializer.EPOCH_OFFSET}; + + public OptOut(String tag) { + this.tag = tag; + } + + public boolean skipIt() { + return Arrays.asList(optOutTag).contains(tag); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonArchetypeNodeId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonArchetypeNodeId.java new file mode 100644 index 0000000..bda02e8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonArchetypeNodeId.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import org.ehrbase.openehr.sdk.util.SnakeCase; + +/** + * Created by christian on 6/22/2017. + */ +public class RawJsonArchetypeNodeId { + + String originalKey; + + public RawJsonArchetypeNodeId(String originalKey) { + this.originalKey = originalKey; + } + + public String toString() { + String key = originalKey; + // strip the [...] node predicate + if (key.contains("[")) { + key = key.substring(key.indexOf("[") + 1, key.indexOf("]")); + } + return new SnakeCase(key).camelToSnake(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonKey.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonKey.java new file mode 100644 index 0000000..9d588ad --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/RawJsonKey.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import org.ehrbase.openehr.sdk.util.SnakeCase; + +/** + * Created by christian on 6/22/2017. + */ +public class RawJsonKey { + + String originalKey; + + public RawJsonKey(String originalKey) { + this.originalKey = originalKey; + } + + public String toRawJson() { + String key = originalKey; + if (key.startsWith("/")) key = originalKey.substring(1); + // strip the [...] node predicate + if (key.contains("[")) { + key = key.substring(0, key.indexOf("[")); + } + return new SnakeCase(key).camelToSnake(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Siblings.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Siblings.java new file mode 100644 index 0000000..dc01010 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/Siblings.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2019 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import java.util.ArrayList; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +public class Siblings { + + ArrayList arrayList; + + public Siblings(ArrayList arrayList) { + this.arrayList = arrayList; + } + + public String archetypeNodeId() { + for (LinkedTreeMap linkedTreeMap : arrayList) { + if (linkedTreeMap.get(I_DvTypeAdapter.ARCHETYPE_NODE_ID) != null) { + return (String) linkedTreeMap.get(I_DvTypeAdapter.ARCHETYPE_NODE_ID); + } + } + return null; + } + + public String type() { + for (LinkedTreeMap linkedTreeMap : arrayList) { + if (linkedTreeMap.get(I_DvTypeAdapter.AT_TYPE) != null) { + return (String) linkedTreeMap.get(I_DvTypeAdapter.AT_TYPE); + } else if (linkedTreeMap.get(CompositionSerializer.TAG_CLASS) != null) { + return (String) linkedTreeMap.get(CompositionSerializer.TAG_CLASS); + } + } + return null; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ValueArrayList.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ValueArrayList.java new file mode 100644 index 0000000..c5e938f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/dbencoding/wrappers/json/writer/translator_db2raw/ValueArrayList.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2020 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.writer.translator_db2raw; + +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.CompositionSerializer; +import org.ehrbase.migration.exporter.v0.jooq.dbencoding.wrappers.json.I_DvTypeAdapter; + +/** + * deals with values passed as an array. This is a tweak since we use MultiValueMap which is backed by an ArrayList + * hence the problem to retrieve a value which should have been a string but come out as an array of string of size 1 + */ +public class ValueArrayList { + private final JsonWriter writer; + private final ArrayList value; + private final String tag; + + ValueArrayList(JsonWriter writer, Object value, String tag) { + this.writer = writer; + if (value instanceof ArrayList) this.value = (ArrayList) value; + else throw new IllegalStateException("Invalid value passed as argument"); + this.tag = tag; + } + + public void write() throws IOException { + if (value.isEmpty()) return; + + switch (tag) { + case CompositionSerializer.TAG_NAME: + LinkedTreeMap nameEncoded = (value.get(0) instanceof ArrayList) + ? ((LinkedTreeMap) ((ArrayList) value.get(0)).get(0)) + : ((LinkedTreeMap) (value.get(0))); + + if (nameEncoded.size() == 1) { + new DvTextNameValue(writer, nameEncoded).write(); + } + if (nameEncoded.size() > 1) { // dvCodedText + new DvCodedTextNameValue(writer, nameEncoded).write(); + } + + break; + case CompositionSerializer.TAG_ARCHETYPE_NODE_ID: + writer.name(I_DvTypeAdapter.ARCHETYPE_NODE_ID) + .value(value.get(0).toString()); + break; + default: + throw new IllegalStateException("Unknown serialization tag:" + tag); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/DefaultCatalog.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/DefaultCatalog.java new file mode 100644 index 0000000..d294d12 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/DefaultCatalog.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import java.util.Arrays; +import java.util.List; +import org.jooq.Constants; +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class DefaultCatalog extends CatalogImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of DEFAULT_CATALOG + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema ehr. + */ + public final Ehr EHR = Ehr.EHR; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + return Arrays.asList(Ehr.EHR); + } + + /** + * A reference to the 3.18 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.18. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18; +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Ehr.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Ehr.java new file mode 100644 index 0000000..2b6ac49 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Ehr.java @@ -0,0 +1,1082 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Access; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Attestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestationRef; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestedView; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AuditDetails; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompExpand; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompoXref; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Composition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Concept; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Contribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolder; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolderHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrStatus; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Entry; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EntryHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContext; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContextHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Heading; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Identifier; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Language; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Participation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.ParticipationHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Plugin; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.SessionLog; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Status; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StoredQuery; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.System; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Tenant; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TerminologyProvider; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Territory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Users; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAttestationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAuditRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteContributionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrFullRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEventContextForCompoRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteTenantFullRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsForContribRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedContributionsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedStatusForContribRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetTemplateUsageRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.JsonbArrayElementsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyUsageIdentificationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.XjsonbArrayElementsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText; +import org.jooq.Catalog; +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Result; +import org.jooq.Sequence; +import org.jooq.Table; +import org.jooq.UDT; +import org.jooq.impl.SchemaImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Ehr extends SchemaImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr + */ + public static final Ehr EHR = new Ehr(); + + /** + * defines the modality for accessing an com.ethercis.ehr (security strategy + * implementation) + */ + public final Access ACCESS = Access.ACCESS; + + /** + * The table ehr.admin_delete_attestation. + */ + public final AdminDeleteAttestation ADMIN_DELETE_ATTESTATION = AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION; + + /** + * Call ehr.admin_delete_attestation. + */ + public static Result ADMIN_DELETE_ATTESTATION( + Configuration configuration, UUID attestRefInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION + .call(attestRefInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_attestation as a table. + */ + public static AdminDeleteAttestation ADMIN_DELETE_ATTESTATION(UUID attestRefInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.call( + attestRefInput); + } + + /** + * Get ehr.admin_delete_attestation as a table. + */ + public static AdminDeleteAttestation ADMIN_DELETE_ATTESTATION(Field attestRefInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.call( + attestRefInput); + } + + /** + * The table ehr.admin_delete_audit. + */ + public final AdminDeleteAudit ADMIN_DELETE_AUDIT = AdminDeleteAudit.ADMIN_DELETE_AUDIT; + + /** + * Call ehr.admin_delete_audit. + */ + public static Result ADMIN_DELETE_AUDIT(Configuration configuration, UUID auditInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call( + auditInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_audit as a table. + */ + public static AdminDeleteAudit ADMIN_DELETE_AUDIT(UUID auditInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call(auditInput); + } + + /** + * Get ehr.admin_delete_audit as a table. + */ + public static AdminDeleteAudit ADMIN_DELETE_AUDIT(Field auditInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call(auditInput); + } + + /** + * The table ehr.admin_delete_composition. + */ + public final AdminDeleteComposition ADMIN_DELETE_COMPOSITION = AdminDeleteComposition.ADMIN_DELETE_COMPOSITION; + + /** + * Call ehr.admin_delete_composition. + */ + public static Result ADMIN_DELETE_COMPOSITION( + Configuration configuration, UUID compoIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION + .call(compoIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_composition as a table. + */ + public static AdminDeleteComposition ADMIN_DELETE_COMPOSITION(UUID compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.call( + compoIdInput); + } + + /** + * Get ehr.admin_delete_composition as a table. + */ + public static AdminDeleteComposition ADMIN_DELETE_COMPOSITION(Field compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.call( + compoIdInput); + } + + /** + * The table ehr.admin_delete_composition_history. + */ + public final AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY = + AdminDeleteCompositionHistory.ADMIN_DELETE_COMPOSITION_HISTORY; + + /** + * Call ehr.admin_delete_composition_history. + */ + public static Result ADMIN_DELETE_COMPOSITION_HISTORY( + Configuration configuration, UUID compoInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_composition_history as a table. + */ + public static AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY(UUID compoInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput); + } + + /** + * Get ehr.admin_delete_composition_history as a table. + */ + public static AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY(Field compoInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput); + } + + /** + * The table ehr.admin_delete_contribution. + */ + public final AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION = AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION; + + /** + * Call ehr.admin_delete_contribution. + */ + public static Result ADMIN_DELETE_CONTRIBUTION( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution + .ADMIN_DELETE_CONTRIBUTION + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_contribution as a table. + */ + public static AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.call( + contribIdInput); + } + + /** + * Get ehr.admin_delete_contribution as a table. + */ + public static AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION(Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.call( + contribIdInput); + } + + /** + * The table ehr.admin_delete_ehr. + */ + public final AdminDeleteEhr ADMIN_DELETE_EHR = AdminDeleteEhr.ADMIN_DELETE_EHR; + + /** + * Call ehr.admin_delete_ehr. + */ + public static Result ADMIN_DELETE_EHR(Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call( + ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr as a table. + */ + public static AdminDeleteEhr ADMIN_DELETE_EHR(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call(ehrIdInput); + } + + /** + * Get ehr.admin_delete_ehr as a table. + */ + public static AdminDeleteEhr ADMIN_DELETE_EHR(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call(ehrIdInput); + } + + /** + * The table ehr.admin_delete_ehr_full. + */ + public final AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL = AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL; + + /** + * Call ehr.admin_delete_ehr_full. + */ + public static Result ADMIN_DELETE_EHR_FULL(Configuration configuration, UUID ehrIdParam) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr_full as a table. + */ + public static AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL(UUID ehrIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam); + } + + /** + * Get ehr.admin_delete_ehr_full as a table. + */ + public static AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL(Field ehrIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam); + } + + /** + * The table ehr.admin_delete_ehr_history. + */ + public final AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY = AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY; + + /** + * Call ehr.admin_delete_ehr_history. + */ + public static Result ADMIN_DELETE_EHR_HISTORY( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr_history as a table. + */ + public static AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.call( + ehrIdInput); + } + + /** + * Get ehr.admin_delete_ehr_history as a table. + */ + public static AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.call( + ehrIdInput); + } + + /** + * The table ehr.admin_delete_event_context_for_compo. + */ + public final AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO = + AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO; + + /** + * Call ehr.admin_delete_event_context_for_compo. + */ + public static Result ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO( + Configuration configuration, UUID compoIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_event_context_for_compo as a table. + */ + public static AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO(UUID compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput); + } + + /** + * Get ehr.admin_delete_event_context_for_compo as a table. + */ + public static AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO(Field compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput); + } + + /** + * The table ehr.admin_delete_status. + */ + public final AdminDeleteStatus ADMIN_DELETE_STATUS = AdminDeleteStatus.ADMIN_DELETE_STATUS; + + /** + * Call ehr.admin_delete_status. + */ + public static Result ADMIN_DELETE_STATUS(Configuration configuration, UUID statusIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_status as a table. + */ + public static AdminDeleteStatus ADMIN_DELETE_STATUS(UUID statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput); + } + + /** + * Get ehr.admin_delete_status as a table. + */ + public static AdminDeleteStatus ADMIN_DELETE_STATUS(Field statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput); + } + + /** + * The table ehr.admin_delete_status_history. + */ + public final AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY = + AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY; + + /** + * Call ehr.admin_delete_status_history. + */ + public static Result ADMIN_DELETE_STATUS_HISTORY( + Configuration configuration, UUID statusIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory + .ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_status_history as a table. + */ + public static AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY(UUID statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput); + } + + /** + * Get ehr.admin_delete_status_history as a table. + */ + public static AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY(Field statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput); + } + + /** + * The table ehr.admin_delete_tenant_full. + */ + public final AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL = AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL; + + /** + * Call ehr.admin_delete_tenant_full. + */ + public static Result ADMIN_DELETE_TENANT_FULL( + Configuration configuration, Short tenantIdParam) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL + .call(tenantIdParam)) + .fetch(); + } + + /** + * Get ehr.admin_delete_tenant_full as a table. + */ + public static AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL(Short tenantIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.call( + tenantIdParam); + } + + /** + * Get ehr.admin_delete_tenant_full as a table. + */ + public static AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL(Field tenantIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.call( + tenantIdParam); + } + + /** + * The table ehr.admin_get_linked_compositions. + */ + public final AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS = + AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS; + + /** + * Call ehr.admin_get_linked_compositions. + */ + public static Result ADMIN_GET_LINKED_COMPOSITIONS( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions + .ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_compositions as a table. + */ + public static AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput); + } + + /** + * Get ehr.admin_get_linked_compositions as a table. + */ + public static AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput); + } + + /** + * The table ehr.admin_get_linked_compositions_for_contrib. + */ + public final AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB = + AdminGetLinkedCompositionsForContrib.ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB; + + /** + * Call ehr.admin_get_linked_compositions_for_contrib. + */ + public static Result ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_compositions_for_contrib as a + * table. + */ + public static AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Get ehr.admin_get_linked_compositions_for_contrib as a + * table. + */ + public static AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB( + Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * The table ehr.admin_get_linked_contributions. + */ + public final AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS = + AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS; + + /** + * Call ehr.admin_get_linked_contributions. + */ + public static Result ADMIN_GET_LINKED_CONTRIBUTIONS( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_contributions as a table. + */ + public static AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput); + } + + /** + * Get ehr.admin_get_linked_contributions as a table. + */ + public static AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput); + } + + /** + * The table ehr.admin_get_linked_status_for_contrib. + */ + public final AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB = + AdminGetLinkedStatusForContrib.ADMIN_GET_LINKED_STATUS_FOR_CONTRIB; + + /** + * Call ehr.admin_get_linked_status_for_contrib. + */ + public static Result ADMIN_GET_LINKED_STATUS_FOR_CONTRIB( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_status_for_contrib as a table. + */ + public static AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Get ehr.admin_get_linked_status_for_contrib as a table. + */ + public static AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB(Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * The table ehr.admin_get_template_usage. + */ + public final AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE = AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE; + + /** + * Call ehr.admin_get_template_usage. + */ + public static Result ADMIN_GET_TEMPLATE_USAGE( + Configuration configuration, String targetId) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE + .call(targetId)) + .fetch(); + } + + /** + * Get ehr.admin_get_template_usage as a table. + */ + public static AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE(String targetId) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.call( + targetId); + } + + /** + * Get ehr.admin_get_template_usage as a table. + */ + public static AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE(Field targetId) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.call( + targetId); + } + + /** + * The table ehr.attestation. + */ + public final Attestation ATTESTATION = Attestation.ATTESTATION; + + /** + * The table ehr.attestation_ref. + */ + public final AttestationRef ATTESTATION_REF = AttestationRef.ATTESTATION_REF; + + /** + * The table ehr.attested_view. + */ + public final AttestedView ATTESTED_VIEW = AttestedView.ATTESTED_VIEW; + + /** + * The table ehr.audit_details. + */ + public final AuditDetails AUDIT_DETAILS = AuditDetails.AUDIT_DETAILS; + + /** + * The table ehr.comp_expand. + */ + public final CompExpand COMP_EXPAND = CompExpand.COMP_EXPAND; + + /** + * The table ehr.compo_xref. + */ + public final CompoXref COMPO_XREF = CompoXref.COMPO_XREF; + + /** + * Composition table + */ + public final Composition COMPOSITION = Composition.COMPOSITION; + + /** + * The table ehr.composition_history. + */ + public final CompositionHistory COMPOSITION_HISTORY = CompositionHistory.COMPOSITION_HISTORY; + + /** + * openEHR common concepts (e.g. terminology) used in the system + */ + public final Concept CONCEPT = Concept.CONCEPT; + + /** + * Contribution table, compositions reference this table + */ + public final Contribution CONTRIBUTION = Contribution.CONTRIBUTION; + + /** + * EHR itself + */ + public final org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr EHR_ = + org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr.EHR_; + + /** + * The table ehr.ehr_folder. + */ + public final EhrFolder EHR_FOLDER = EhrFolder.EHR_FOLDER; + + /** + * The table ehr.ehr_folder_history. + */ + public final EhrFolderHistory EHR_FOLDER_HISTORY = EhrFolderHistory.EHR_FOLDER_HISTORY; + + /** + * The table ehr.ehr_status. + */ + public final EhrStatus EHR_STATUS = EhrStatus.EHR_STATUS; + + /** + * this table hold the actual archetyped data values (fromBinder a template) + */ + public final Entry ENTRY = Entry.ENTRY; + + /** + * The table ehr.entry_history. + */ + public final EntryHistory ENTRY_HISTORY = EntryHistory.ENTRY_HISTORY; + + /** + * defines the context of an event (time, who, where... see openEHR IM 5.2 + */ + public final EventContext EVENT_CONTEXT = EventContext.EVENT_CONTEXT; + + /** + * The table ehr.event_context_history. + */ + public final EventContextHistory EVENT_CONTEXT_HISTORY = EventContextHistory.EVENT_CONTEXT_HISTORY; + + /** + * The table ehr.flyway_schema_history. + */ + public final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY; + + /** + * The table ehr.heading. + */ + public final Heading HEADING = Heading.HEADING; + + /** + * specifies an identifier for a party identified, more than one identifier + * is possible + */ + public final Identifier IDENTIFIER = Identifier.IDENTIFIER; + + /** + * The table ehr.jsonb_array_elements. + */ + public final JsonbArrayElements JSONB_ARRAY_ELEMENTS = JsonbArrayElements.JSONB_ARRAY_ELEMENTS; + + /** + * Call ehr.jsonb_array_elements. + */ + public static Result JSONB_ARRAY_ELEMENTS(Configuration configuration, JSONB jsonbVal) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call( + jsonbVal)) + .fetch(); + } + + /** + * Get ehr.jsonb_array_elements as a table. + */ + public static JsonbArrayElements JSONB_ARRAY_ELEMENTS(JSONB jsonbVal) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call(jsonbVal); + } + + /** + * Get ehr.jsonb_array_elements as a table. + */ + public static JsonbArrayElements JSONB_ARRAY_ELEMENTS(Field jsonbVal) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call(jsonbVal); + } + + /** + * ISO 639-1 language codeset + */ + public final Language LANGUAGE = Language.LANGUAGE; + + /** + * define a participating party for an event f.ex. + */ + public final Participation PARTICIPATION = Participation.PARTICIPATION; + + /** + * The table ehr.participation_history. + */ + public final ParticipationHistory PARTICIPATION_HISTORY = ParticipationHistory.PARTICIPATION_HISTORY; + + /** + * The table ehr.party_identified. + */ + public final PartyIdentified PARTY_IDENTIFIED = PartyIdentified.PARTY_IDENTIFIED; + + /** + * The table ehr.party_usage_identification. + */ + public final PartyUsageIdentification PARTY_USAGE_IDENTIFICATION = + PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION; + + /** + * Call ehr.party_usage_identification. + */ + public static Result PARTY_USAGE_IDENTIFICATION( + Configuration configuration, UUID partyUuid) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification + .PARTY_USAGE_IDENTIFICATION + .call(partyUuid)) + .fetch(); + } + + /** + * Get ehr.party_usage_identification as a table. + */ + public static PartyUsageIdentification PARTY_USAGE_IDENTIFICATION(UUID partyUuid) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION + .call(partyUuid); + } + + /** + * Get ehr.party_usage_identification as a table. + */ + public static PartyUsageIdentification PARTY_USAGE_IDENTIFICATION(Field partyUuid) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION + .call(partyUuid); + } + + /** + * key value store for plugin sub system + */ + public final Plugin PLUGIN = Plugin.PLUGIN; + + /** + * The table ehr.session_log. + */ + public final SessionLog SESSION_LOG = SessionLog.SESSION_LOG; + + /** + * specifies an ehr modality and ownership (patient) + */ + public final Status STATUS = Status.STATUS; + + /** + * The table ehr.status_history. + */ + public final StatusHistory STATUS_HISTORY = StatusHistory.STATUS_HISTORY; + + /** + * The table ehr.stored_query. + */ + public final StoredQuery STORED_QUERY = StoredQuery.STORED_QUERY; + + /** + * system table for reference + */ + public final System SYSTEM = System.SYSTEM; + + /** + * The table ehr.template_store. + */ + public final TemplateStore TEMPLATE_STORE = TemplateStore.TEMPLATE_STORE; + + /** + * The table ehr.tenant. + */ + public final Tenant TENANT = Tenant.TENANT; + + /** + * openEHR identified terminology provider + */ + public final TerminologyProvider TERMINOLOGY_PROVIDER = TerminologyProvider.TERMINOLOGY_PROVIDER; + + /** + * ISO 3166-1 countries codeset + */ + public final Territory TERRITORY = Territory.TERRITORY; + + /** + * The table ehr.users. + */ + public final Users USERS = Users.USERS; + + /** + * The table ehr.xjsonb_array_elements. + */ + public final XjsonbArrayElements XJSONB_ARRAY_ELEMENTS = XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS; + + /** + * Call ehr.xjsonb_array_elements. + */ + public static Result XJSONB_ARRAY_ELEMENTS(Configuration configuration, JSONB entry) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call( + entry)) + .fetch(); + } + + /** + * Get ehr.xjsonb_array_elements as a table. + */ + public static XjsonbArrayElements XJSONB_ARRAY_ELEMENTS(JSONB entry) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call(entry); + } + + /** + * Get ehr.xjsonb_array_elements as a table. + */ + public static XjsonbArrayElements XJSONB_ARRAY_ELEMENTS(Field entry) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call(entry); + } + + /** + * No further instances allowed + */ + private Ehr() { + super("ehr", null); + } + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getSequences() { + return Arrays.asList(Sequences.SYS_TENANT_SEQ); + } + + @Override + public final List> getTables() { + return Arrays.asList( + Access.ACCESS, + AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION, + AdminDeleteAudit.ADMIN_DELETE_AUDIT, + AdminDeleteComposition.ADMIN_DELETE_COMPOSITION, + AdminDeleteCompositionHistory.ADMIN_DELETE_COMPOSITION_HISTORY, + AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION, + AdminDeleteEhr.ADMIN_DELETE_EHR, + AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL, + AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY, + AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO, + AdminDeleteStatus.ADMIN_DELETE_STATUS, + AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY, + AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL, + AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS, + AdminGetLinkedCompositionsForContrib.ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB, + AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS, + AdminGetLinkedStatusForContrib.ADMIN_GET_LINKED_STATUS_FOR_CONTRIB, + AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE, + Attestation.ATTESTATION, + AttestationRef.ATTESTATION_REF, + AttestedView.ATTESTED_VIEW, + AuditDetails.AUDIT_DETAILS, + CompExpand.COMP_EXPAND, + CompoXref.COMPO_XREF, + Composition.COMPOSITION, + CompositionHistory.COMPOSITION_HISTORY, + Concept.CONCEPT, + Contribution.CONTRIBUTION, + org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr.EHR_, + EhrFolder.EHR_FOLDER, + EhrFolderHistory.EHR_FOLDER_HISTORY, + EhrStatus.EHR_STATUS, + Entry.ENTRY, + EntryHistory.ENTRY_HISTORY, + EventContext.EVENT_CONTEXT, + EventContextHistory.EVENT_CONTEXT_HISTORY, + FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + Heading.HEADING, + Identifier.IDENTIFIER, + JsonbArrayElements.JSONB_ARRAY_ELEMENTS, + Language.LANGUAGE, + Participation.PARTICIPATION, + ParticipationHistory.PARTICIPATION_HISTORY, + PartyIdentified.PARTY_IDENTIFIED, + PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION, + Plugin.PLUGIN, + SessionLog.SESSION_LOG, + Status.STATUS, + StatusHistory.STATUS_HISTORY, + StoredQuery.STORED_QUERY, + System.SYSTEM, + TemplateStore.TEMPLATE_STORE, + Tenant.TENANT, + TerminologyProvider.TERMINOLOGY_PROVIDER, + Territory.TERRITORY, + Users.USERS, + XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS); + } + + @Override + public final List> getUDTs() { + return Arrays.asList(CodePhrase.CODE_PHRASE, DvCodedText.DV_CODED_TEXT); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Indexes.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Indexes.java new file mode 100644 index 0000000..88c587f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Indexes.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Attestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestedView; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompoXref; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Composition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Concept; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Contribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Entry; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EntryHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContext; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContextHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Identifier; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Participation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.ParticipationHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Status; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.System; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Territory; +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +/** + * A class modelling indexes of tables in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index ATTESTATION_REFERENCE_IDX = Internal.createIndex( + DSL.name("attestation_reference_idx"), + Attestation.ATTESTATION, + new OrderField[] {Attestation.ATTESTATION.REFERENCE, Attestation.ATTESTATION.SYS_TENANT}, + false); + public static final Index ATTESTED_VIEW_ATTESTATION_IDX = Internal.createIndex( + DSL.name("attested_view_attestation_idx"), + AttestedView.ATTESTED_VIEW, + new OrderField[] {AttestedView.ATTESTED_VIEW.ATTESTATION_ID, AttestedView.ATTESTED_VIEW.SYS_TENANT}, + false); + public static final Index COMPO_XREF_CHILD_IDX = Internal.createIndex( + DSL.name("compo_xref_child_idx"), + CompoXref.COMPO_XREF, + new OrderField[] {CompoXref.COMPO_XREF.CHILD_UUID, CompoXref.COMPO_XREF.SYS_TENANT}, + false); + public static final Index COMPOSITION_COMPOSER_IDX = Internal.createIndex( + DSL.name("composition_composer_idx"), + Composition.COMPOSITION, + new OrderField[] {Composition.COMPOSITION.COMPOSER, Composition.COMPOSITION.SYS_TENANT}, + false); + public static final Index COMPOSITION_EHR_IDX = Internal.createIndex( + DSL.name("composition_ehr_idx"), + Composition.COMPOSITION, + new OrderField[] {Composition.COMPOSITION.EHR_ID, Composition.COMPOSITION.SYS_TENANT}, + false); + public static final Index COMPOSITION_HISTORY_EHR_IDX = Internal.createIndex( + DSL.name("composition_history_ehr_idx"), + CompositionHistory.COMPOSITION_HISTORY, + new OrderField[] { + CompositionHistory.COMPOSITION_HISTORY.EHR_ID, CompositionHistory.COMPOSITION_HISTORY.SYS_TENANT + }, + false); + public static final Index CONTEXT_COMPOSITION_ID_IDX = Internal.createIndex( + DSL.name("context_composition_id_idx"), + EventContext.EVENT_CONTEXT, + new OrderField[] {EventContext.EVENT_CONTEXT.COMPOSITION_ID, EventContext.EVENT_CONTEXT.SYS_TENANT}, + true); + public static final Index CONTEXT_FACILITY_IDX = Internal.createIndex( + DSL.name("context_facility_idx"), + EventContext.EVENT_CONTEXT, + new OrderField[] {EventContext.EVENT_CONTEXT.FACILITY, EventContext.EVENT_CONTEXT.SYS_TENANT}, + false); + public static final Index CONTEXT_PARTICIPATION_INDEX = Internal.createIndex( + DSL.name("context_participation_index"), + Participation.PARTICIPATION, + new OrderField[] {Participation.PARTICIPATION.EVENT_CONTEXT, Participation.PARTICIPATION.SYS_TENANT}, + false); + public static final Index CONTEXT_SETTING_IDX = Internal.createIndex( + DSL.name("context_setting_idx"), + EventContext.EVENT_CONTEXT, + new OrderField[] {EventContext.EVENT_CONTEXT.SETTING, EventContext.EVENT_CONTEXT.SYS_TENANT}, + false); + public static final Index CONTRIBUTION_EHR_IDX = Internal.createIndex( + DSL.name("contribution_ehr_idx"), + Contribution.CONTRIBUTION, + new OrderField[] {Contribution.CONTRIBUTION.EHR_ID, Contribution.CONTRIBUTION.SYS_TENANT}, + false); + public static final Index EHR_COMPO_XREF = Internal.createIndex( + DSL.name("ehr_compo_xref"), + CompoXref.COMPO_XREF, + new OrderField[] {CompoXref.COMPO_XREF.MASTER_UUID, CompoXref.COMPO_XREF.SYS_TENANT}, + false); + public static final Index EHR_COMPOSITION_HISTORY = Internal.createIndex( + DSL.name("ehr_composition_history"), + CompositionHistory.COMPOSITION_HISTORY, + new OrderField[] { + CompositionHistory.COMPOSITION_HISTORY.ID, CompositionHistory.COMPOSITION_HISTORY.SYS_TENANT + }, + false); + public static final Index EHR_CONCEPT_ID_LANGUAGE_IDX = Internal.createIndex( + DSL.name("ehr_concept_id_language_idx"), + Concept.CONCEPT, + new OrderField[] {Concept.CONCEPT.CONCEPTID, Concept.CONCEPT.LANGUAGE}, + false); + public static final Index EHR_ENTRY_HISTORY = Internal.createIndex( + DSL.name("ehr_entry_history"), + EntryHistory.ENTRY_HISTORY, + new OrderField[] {EntryHistory.ENTRY_HISTORY.ID, EntryHistory.ENTRY_HISTORY.SYS_TENANT}, + false); + public static final Index EHR_EVENT_CONTEXT_HISTORY = Internal.createIndex( + DSL.name("ehr_event_context_history"), + EventContextHistory.EVENT_CONTEXT_HISTORY, + new OrderField[] { + EventContextHistory.EVENT_CONTEXT_HISTORY.ID, EventContextHistory.EVENT_CONTEXT_HISTORY.SYS_TENANT + }, + false); + public static final Index EHR_IDENTIFIER_PARTY_IDX = Internal.createIndex( + DSL.name("ehr_identifier_party_idx"), + Identifier.IDENTIFIER, + new OrderField[] {Identifier.IDENTIFIER.PARTY, Identifier.IDENTIFIER.SYS_TENANT}, + false); + public static final Index EHR_PARTICIPATION_HISTORY = Internal.createIndex( + DSL.name("ehr_participation_history"), + ParticipationHistory.PARTICIPATION_HISTORY, + new OrderField[] { + ParticipationHistory.PARTICIPATION_HISTORY.ID, ParticipationHistory.PARTICIPATION_HISTORY.SYS_TENANT + }, + false); + public static final Index EHR_STATUS_HISTORY = Internal.createIndex( + DSL.name("ehr_status_history"), + StatusHistory.STATUS_HISTORY, + new OrderField[] {StatusHistory.STATUS_HISTORY.ID, StatusHistory.STATUS_HISTORY.SYS_TENANT}, + false); + public static final Index EHR_SYSTEM_SETTINGS_IDX = Internal.createIndex( + DSL.name("ehr_system_settings_idx"), System.SYSTEM, new OrderField[] {System.SYSTEM.SETTINGS}, true); + public static final Index EHR_TERRITORY_TWOLETTER_IDX = Internal.createIndex( + DSL.name("ehr_territory_twoletter_idx"), + Territory.TERRITORY, + new OrderField[] {Territory.TERRITORY.TWOLETTER}, + true); + public static final Index ENTRY_HISTORY_COMPOSITION_IDX = Internal.createIndex( + DSL.name("entry_history_composition_idx"), + EntryHistory.ENTRY_HISTORY, + new OrderField[] {EntryHistory.ENTRY_HISTORY.COMPOSITION_ID, EntryHistory.ENTRY_HISTORY.SYS_TENANT}, + false); + public static final Index EVENT_CONTEXT_HISTORY_COMPOSITION_IDX = Internal.createIndex( + DSL.name("event_context_history_composition_idx"), + EventContextHistory.EVENT_CONTEXT_HISTORY, + new OrderField[] { + EventContextHistory.EVENT_CONTEXT_HISTORY.COMPOSITION_ID, + EventContextHistory.EVENT_CONTEXT_HISTORY.SYS_TENANT + }, + false); + public static final Index FLYWAY_SCHEMA_HISTORY_S_IDX = Internal.createIndex( + DSL.name("flyway_schema_history_s_idx"), + FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + new OrderField[] {FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SUCCESS}, + false); + public static final Index IDENTIFIER_VALUE_IDX = Internal.createIndex( + DSL.name("identifier_value_idx"), + Identifier.IDENTIFIER, + new OrderField[] {Identifier.IDENTIFIER.ID_VALUE, Identifier.IDENTIFIER.SYS_TENANT}, + false); + public static final Index PARTICIPATION_HISTORY_EVENT_CONTEXT_IDX = Internal.createIndex( + DSL.name("participation_history_event_context_idx"), + ParticipationHistory.PARTICIPATION_HISTORY, + new OrderField[] { + ParticipationHistory.PARTICIPATION_HISTORY.EVENT_CONTEXT, + ParticipationHistory.PARTICIPATION_HISTORY.SYS_TENANT + }, + false); + public static final Index PARTY_IDENTIFIED_NAMESPACE_VALUE_IDX = Internal.createIndex( + DSL.name("party_identified_namespace_value_idx"), + PartyIdentified.PARTY_IDENTIFIED, + new OrderField[] { + PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_NAMESPACE, + PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_VALUE, + PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT + }, + false); + public static final Index PARTY_IDENTIFIED_PARTY_REF_IDX = Internal.createIndex( + DSL.name("party_identified_party_ref_idx"), + PartyIdentified.PARTY_IDENTIFIED, + new OrderField[] { + PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_NAMESPACE, + PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_SCHEME, + PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_VALUE, + PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT + }, + false); + public static final Index PARTY_IDENTIFIED_PARTY_TYPE_IDX = Internal.createIndex( + DSL.name("party_identified_party_type_idx"), + PartyIdentified.PARTY_IDENTIFIED, + new OrderField[] { + PartyIdentified.PARTY_IDENTIFIED.PARTY_TYPE, + PartyIdentified.PARTY_IDENTIFIED.NAME, + PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT + }, + false); + public static final Index STATUS_HISTORY_EHR_IDX = Internal.createIndex( + DSL.name("status_history_ehr_idx"), + StatusHistory.STATUS_HISTORY, + new OrderField[] {StatusHistory.STATUS_HISTORY.EHR_ID, StatusHistory.STATUS_HISTORY.SYS_TENANT}, + false); + public static final Index STATUS_PARTY_IDX = Internal.createIndex( + DSL.name("status_party_idx"), + Status.STATUS, + new OrderField[] {Status.STATUS.PARTY, Status.STATUS.SYS_TENANT}, + false); + public static final Index TEMPLATE_ENTRY_IDX = Internal.createIndex( + DSL.name("template_entry_idx"), + Entry.ENTRY, + new OrderField[] {Entry.ENTRY.TEMPLATE_ID, Entry.ENTRY.SYS_TENANT}, + false); + public static final Index TEMPLATE_STORE_TEMPLATE_ID = Internal.createIndex( + DSL.name("template_store_template_id"), + TemplateStore.TEMPLATE_STORE, + new OrderField[] {TemplateStore.TEMPLATE_STORE.TEMPLATE_ID, TemplateStore.TEMPLATE_STORE.SYS_TENANT}, + true); + public static final Index TERRITORY_CODE_INDEX = Internal.createIndex( + DSL.name("territory_code_index"), Territory.TERRITORY, new OrderField[] {Territory.TERRITORY.CODE}, true); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Keys.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Keys.java new file mode 100644 index 0000000..e5d8556 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Keys.java @@ -0,0 +1,772 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Access; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Attestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestationRef; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestedView; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AuditDetails; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompoXref; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Composition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Concept; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Contribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolder; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolderHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Entry; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EntryHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContext; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContextHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Heading; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Identifier; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Language; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Participation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.ParticipationHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Plugin; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.SessionLog; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Status; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StoredQuery; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.System; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Tenant; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TerminologyProvider; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Territory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Users; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AccessRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AttestationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AttestationRefRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AttestedViewRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompoXrefRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompositionHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompositionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ConceptRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ContributionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrFolderHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrFolderRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EntryHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EntryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EventContextHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EventContextRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.FlywaySchemaHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.HeadingRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.IdentifierRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.LanguageRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ParticipationHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ParticipationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyIdentifiedRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PluginRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.SessionLogRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StatusHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StatusRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StoredQueryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.SystemRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TemplateStoreRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TenantRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TerminologyProviderRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TerritoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.UsersRecord; +import org.jooq.ForeignKey; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +/** + * A class modelling foreign key relationships and constraints of tables in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Keys { + + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- + + public static final UniqueKey ACCESS_PKEY = Internal.createUniqueKey( + Access.ACCESS, + DSL.name("access_pkey"), + new TableField[] {Access.ACCESS.ID, Access.ACCESS.SYS_TENANT}, + true); + public static final UniqueKey ATTESTATION_PKEY = Internal.createUniqueKey( + Attestation.ATTESTATION, + DSL.name("attestation_pkey"), + new TableField[] {Attestation.ATTESTATION.ID, Attestation.ATTESTATION.SYS_TENANT}, + true); + public static final UniqueKey ATTESTATION_REF_PKEY = Internal.createUniqueKey( + AttestationRef.ATTESTATION_REF, + DSL.name("attestation_ref_pkey"), + new TableField[] {AttestationRef.ATTESTATION_REF.REF, AttestationRef.ATTESTATION_REF.SYS_TENANT}, + true); + public static final UniqueKey ATTESTED_VIEW_PKEY = Internal.createUniqueKey( + AttestedView.ATTESTED_VIEW, + DSL.name("attested_view_pkey"), + new TableField[] {AttestedView.ATTESTED_VIEW.ID, AttestedView.ATTESTED_VIEW.SYS_TENANT}, + true); + public static final UniqueKey AUDIT_DETAILS_PKEY = Internal.createUniqueKey( + AuditDetails.AUDIT_DETAILS, + DSL.name("audit_details_pkey"), + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final UniqueKey COMPOSITION_PKEY = Internal.createUniqueKey( + Composition.COMPOSITION, + DSL.name("composition_pkey"), + new TableField[] {Composition.COMPOSITION.ID, Composition.COMPOSITION.SYS_TENANT}, + true); + public static final UniqueKey CONCEPT_PKEY = Internal.createUniqueKey( + Concept.CONCEPT, DSL.name("concept_pkey"), new TableField[] {Concept.CONCEPT.ID}, true); + public static final UniqueKey CONTRIBUTION_PKEY = Internal.createUniqueKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_pkey"), + new TableField[] {Contribution.CONTRIBUTION.ID, Contribution.CONTRIBUTION.SYS_TENANT}, + true); + public static final UniqueKey EHR_PKEY = Internal.createUniqueKey( + Ehr.EHR_, DSL.name("ehr_pkey"), new TableField[] {Ehr.EHR_.ID, Ehr.EHR_.SYS_TENANT}, true); + public static final UniqueKey EHR_FOLDER_PKEY = Internal.createUniqueKey( + EhrFolder.EHR_FOLDER, + DSL.name("ehr_folder_pkey"), + new TableField[] {EhrFolder.EHR_FOLDER.EHR_ID, EhrFolder.EHR_FOLDER.ID, EhrFolder.EHR_FOLDER.SYS_TENANT}, + true); + public static final UniqueKey EHR_FOLDER_HISTORY_PKEY = Internal.createUniqueKey( + EhrFolderHistory.EHR_FOLDER_HISTORY, + DSL.name("ehr_folder_history_pkey"), + new TableField[] { + EhrFolderHistory.EHR_FOLDER_HISTORY.EHR_ID, + EhrFolderHistory.EHR_FOLDER_HISTORY.ID, + EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_VERSION, + EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_TENANT + }, + true); + public static final UniqueKey ENTRY_COMPOSITION_ID_KEY = Internal.createUniqueKey( + Entry.ENTRY, + DSL.name("entry_composition_id_key"), + new TableField[] {Entry.ENTRY.COMPOSITION_ID, Entry.ENTRY.SYS_TENANT}, + true); + public static final UniqueKey ENTRY_PKEY = Internal.createUniqueKey( + Entry.ENTRY, DSL.name("entry_pkey"), new TableField[] {Entry.ENTRY.ID, Entry.ENTRY.SYS_TENANT}, true); + public static final UniqueKey EVENT_CONTEXT_PKEY = Internal.createUniqueKey( + EventContext.EVENT_CONTEXT, + DSL.name("event_context_pkey"), + new TableField[] {EventContext.EVENT_CONTEXT.ID, EventContext.EVENT_CONTEXT.SYS_TENANT}, + true); + public static final UniqueKey FLYWAY_SCHEMA_HISTORY_PK = Internal.createUniqueKey( + FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + DSL.name("flyway_schema_history_pk"), + new TableField[] {FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_RANK}, + true); + public static final UniqueKey HEADING_PKEY = Internal.createUniqueKey( + Heading.HEADING, + DSL.name("heading_pkey"), + new TableField[] {Heading.HEADING.CODE, Heading.HEADING.SYS_TENANT}, + true); + public static final UniqueKey LANGUAGE_PKEY = Internal.createUniqueKey( + Language.LANGUAGE, DSL.name("language_pkey"), new TableField[] {Language.LANGUAGE.CODE}, true); + public static final UniqueKey PARTICIPATION_PKEY = Internal.createUniqueKey( + Participation.PARTICIPATION, + DSL.name("participation_pkey"), + new TableField[] {Participation.PARTICIPATION.ID, Participation.PARTICIPATION.SYS_TENANT}, + true); + public static final UniqueKey PARTY_IDENTIFIED_PKEY = Internal.createUniqueKey( + PartyIdentified.PARTY_IDENTIFIED, + DSL.name("party_identified_pkey"), + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final UniqueKey PLUGIN_PKEY = + Internal.createUniqueKey(Plugin.PLUGIN, DSL.name("plugin_pkey"), new TableField[] {Plugin.PLUGIN.ID}, true); + public static final UniqueKey SESSION_LOG_PKEY = Internal.createUniqueKey( + SessionLog.SESSION_LOG, + DSL.name("session_log_pkey"), + new TableField[] {SessionLog.SESSION_LOG.ID, SessionLog.SESSION_LOG.SYS_TENANT}, + true); + public static final UniqueKey STATUS_EHR_ID_KEY = Internal.createUniqueKey( + Status.STATUS, + DSL.name("status_ehr_id_key"), + new TableField[] {Status.STATUS.EHR_ID, Status.STATUS.SYS_TENANT}, + true); + public static final UniqueKey STATUS_PKEY = Internal.createUniqueKey( + Status.STATUS, + DSL.name("status_pkey"), + new TableField[] {Status.STATUS.ID, Status.STATUS.SYS_TENANT}, + true); + public static final UniqueKey STORED_QUERY_PKEY = Internal.createUniqueKey( + StoredQuery.STORED_QUERY, + DSL.name("stored_query_pkey"), + new TableField[] { + StoredQuery.STORED_QUERY.REVERSE_DOMAIN_NAME, + StoredQuery.STORED_QUERY.SEMANTIC_ID, + StoredQuery.STORED_QUERY.SEMVER, + StoredQuery.STORED_QUERY.SYS_TENANT + }, + true); + public static final UniqueKey SYSTEM_PKEY = + Internal.createUniqueKey(System.SYSTEM, DSL.name("system_pkey"), new TableField[] {System.SYSTEM.ID}, true); + public static final UniqueKey TEMPLATE_STORE_PKEY = Internal.createUniqueKey( + TemplateStore.TEMPLATE_STORE, + DSL.name("template_store_pkey"), + new TableField[] {TemplateStore.TEMPLATE_STORE.ID, TemplateStore.TEMPLATE_STORE.SYS_TENANT}, + true); + public static final UniqueKey TENANT_PKEY = + Internal.createUniqueKey(Tenant.TENANT, DSL.name("tenant_pkey"), new TableField[] {Tenant.TENANT.ID}, true); + public static final UniqueKey TENANT_TENANT_ID_KEY = Internal.createUniqueKey( + Tenant.TENANT, DSL.name("tenant_tenant_id_key"), new TableField[] {Tenant.TENANT.TENANT_ID}, true); + public static final UniqueKey TENANT_TENANT_NAME_KEY = Internal.createUniqueKey( + Tenant.TENANT, DSL.name("tenant_tenant_name_key"), new TableField[] {Tenant.TENANT.TENANT_NAME}, true); + public static final UniqueKey TERMINOLOGY_PROVIDER_PKEY = Internal.createUniqueKey( + TerminologyProvider.TERMINOLOGY_PROVIDER, + DSL.name("terminology_provider_pkey"), + new TableField[] { + TerminologyProvider.TERMINOLOGY_PROVIDER.CODE, TerminologyProvider.TERMINOLOGY_PROVIDER.SYS_TENANT + }, + true); + public static final UniqueKey TERRITORY_PKEY = Internal.createUniqueKey( + Territory.TERRITORY, DSL.name("territory_pkey"), new TableField[] {Territory.TERRITORY.CODE}, true); + public static final UniqueKey USERS_PKEY = Internal.createUniqueKey( + Users.USERS, DSL.name("users_pkey"), new TableField[] {Users.USERS.USERNAME, Users.USERS.SYS_TENANT}, true); + + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- + + public static final ForeignKey ACCESS__ACCESS_SYS_TENANT_FKEY = + Internal.createForeignKey( + Access.ACCESS, + DSL.name("access_sys_tenant_fkey"), + new TableField[] {Access.ACCESS.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey ATTESTATION__ATTESTATION_HAS_AUDIT_FKEY = + Internal.createForeignKey( + Attestation.ATTESTATION, + DSL.name("attestation_has_audit_fkey"), + new TableField[] {Attestation.ATTESTATION.HAS_AUDIT, Attestation.ATTESTATION.SYS_TENANT}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final ForeignKey ATTESTATION__ATTESTATION_REFERENCE_FKEY = + Internal.createForeignKey( + Attestation.ATTESTATION, + DSL.name("attestation_reference_fkey"), + new TableField[] {Attestation.ATTESTATION.REFERENCE, Attestation.ATTESTATION.SYS_TENANT}, + Keys.ATTESTATION_REF_PKEY, + new TableField[] {AttestationRef.ATTESTATION_REF.REF, AttestationRef.ATTESTATION_REF.SYS_TENANT}, + true); + public static final ForeignKey ATTESTATION__ATTESTATION_SYS_TENANT_FKEY = + Internal.createForeignKey( + Attestation.ATTESTATION, + DSL.name("attestation_sys_tenant_fkey"), + new TableField[] {Attestation.ATTESTATION.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + ATTESTATION_REF__ATTESTATION_REF_SYS_TENANT_FKEY = Internal.createForeignKey( + AttestationRef.ATTESTATION_REF, + DSL.name("attestation_ref_sys_tenant_fkey"), + new TableField[] {AttestationRef.ATTESTATION_REF.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + ATTESTED_VIEW__ATTESTED_VIEW_ATTESTATION_ID_FKEY = Internal.createForeignKey( + AttestedView.ATTESTED_VIEW, + DSL.name("attested_view_attestation_id_fkey"), + new TableField[] {AttestedView.ATTESTED_VIEW.ATTESTATION_ID, AttestedView.ATTESTED_VIEW.SYS_TENANT}, + Keys.ATTESTATION_PKEY, + new TableField[] {Attestation.ATTESTATION.ID, Attestation.ATTESTATION.SYS_TENANT}, + true); + public static final ForeignKey ATTESTED_VIEW__ATTESTED_VIEW_SYS_TENANT_FKEY = + Internal.createForeignKey( + AttestedView.ATTESTED_VIEW, + DSL.name("attested_view_sys_tenant_fkey"), + new TableField[] {AttestedView.ATTESTED_VIEW.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + AUDIT_DETAILS__AUDIT_DETAILS_COMMITTER_FKEY = Internal.createForeignKey( + AuditDetails.AUDIT_DETAILS, + DSL.name("audit_details_committer_fkey"), + new TableField[] {AuditDetails.AUDIT_DETAILS.COMMITTER, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey AUDIT_DETAILS__AUDIT_DETAILS_SYS_TENANT_FKEY = + Internal.createForeignKey( + AuditDetails.AUDIT_DETAILS, + DSL.name("audit_details_sys_tenant_fkey"), + new TableField[] {AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey AUDIT_DETAILS__AUDIT_DETAILS_SYSTEM_ID_FKEY = + Internal.createForeignKey( + AuditDetails.AUDIT_DETAILS, + DSL.name("audit_details_system_id_fkey"), + new TableField[] {AuditDetails.AUDIT_DETAILS.SYSTEM_ID}, + Keys.SYSTEM_PKEY, + new TableField[] {System.SYSTEM.ID}, + true); + public static final ForeignKey COMPO_XREF__COMPO_XREF_CHILD_UUID_FKEY = + Internal.createForeignKey( + CompoXref.COMPO_XREF, + DSL.name("compo_xref_child_uuid_fkey"), + new TableField[] {CompoXref.COMPO_XREF.CHILD_UUID, CompoXref.COMPO_XREF.SYS_TENANT}, + Keys.COMPOSITION_PKEY, + new TableField[] {Composition.COMPOSITION.ID, Composition.COMPOSITION.SYS_TENANT}, + true); + public static final ForeignKey COMPO_XREF__COMPO_XREF_MASTER_UUID_FKEY = + Internal.createForeignKey( + CompoXref.COMPO_XREF, + DSL.name("compo_xref_master_uuid_fkey"), + new TableField[] {CompoXref.COMPO_XREF.MASTER_UUID, CompoXref.COMPO_XREF.SYS_TENANT}, + Keys.COMPOSITION_PKEY, + new TableField[] {Composition.COMPOSITION.ID, Composition.COMPOSITION.SYS_TENANT}, + true); + public static final ForeignKey COMPO_XREF__COMPO_XREF_SYS_TENANT_FKEY = + Internal.createForeignKey( + CompoXref.COMPO_XREF, + DSL.name("compo_xref_sys_tenant_fkey"), + new TableField[] {CompoXref.COMPO_XREF.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + COMPOSITION__COMPOSITION_ATTESTATION_REF_FKEY = Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_attestation_ref_fkey"), + new TableField[] {Composition.COMPOSITION.ATTESTATION_REF, Composition.COMPOSITION.SYS_TENANT}, + Keys.ATTESTATION_REF_PKEY, + new TableField[] {AttestationRef.ATTESTATION_REF.REF, AttestationRef.ATTESTATION_REF.SYS_TENANT}, + true); + public static final ForeignKey COMPOSITION__COMPOSITION_COMPOSER_FKEY = + Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_composer_fkey"), + new TableField[] {Composition.COMPOSITION.COMPOSER, Composition.COMPOSITION.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey COMPOSITION__COMPOSITION_EHR_ID_FKEY = + Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_ehr_id_fkey"), + new TableField[] {Composition.COMPOSITION.EHR_ID, Composition.COMPOSITION.SYS_TENANT}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID, Ehr.EHR_.SYS_TENANT}, + true); + public static final ForeignKey COMPOSITION__COMPOSITION_HAS_AUDIT_FKEY = + Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_has_audit_fkey"), + new TableField[] {Composition.COMPOSITION.HAS_AUDIT, Composition.COMPOSITION.SYS_TENANT}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final ForeignKey + COMPOSITION__COMPOSITION_IN_CONTRIBUTION_FKEY = Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_in_contribution_fkey"), + new TableField[] {Composition.COMPOSITION.IN_CONTRIBUTION, Composition.COMPOSITION.SYS_TENANT}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID, Contribution.CONTRIBUTION.SYS_TENANT}, + true); + public static final ForeignKey COMPOSITION__COMPOSITION_LANGUAGE_FKEY = + Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_language_fkey"), + new TableField[] {Composition.COMPOSITION.LANGUAGE}, + Keys.LANGUAGE_PKEY, + new TableField[] {Language.LANGUAGE.CODE}, + true); + public static final ForeignKey COMPOSITION__COMPOSITION_SYS_TENANT_FKEY = + Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_sys_tenant_fkey"), + new TableField[] {Composition.COMPOSITION.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey COMPOSITION__COMPOSITION_TERRITORY_FKEY = + Internal.createForeignKey( + Composition.COMPOSITION, + DSL.name("composition_territory_fkey"), + new TableField[] {Composition.COMPOSITION.TERRITORY}, + Keys.TERRITORY_PKEY, + new TableField[] {Territory.TERRITORY.CODE}, + true); + public static final ForeignKey + COMPOSITION_HISTORY__COMPOSITION_HISTORY_SYS_TENANT_FKEY = Internal.createForeignKey( + CompositionHistory.COMPOSITION_HISTORY, + DSL.name("composition_history_sys_tenant_fkey"), + new TableField[] {CompositionHistory.COMPOSITION_HISTORY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey CONCEPT__CONCEPT_LANGUAGE_FKEY = + Internal.createForeignKey( + Concept.CONCEPT, + DSL.name("concept_language_fkey"), + new TableField[] {Concept.CONCEPT.LANGUAGE}, + Keys.LANGUAGE_PKEY, + new TableField[] {Language.LANGUAGE.CODE}, + true); + public static final ForeignKey CONTRIBUTION__CONTRIBUTION_EHR_ID_FKEY = + Internal.createForeignKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_ehr_id_fkey"), + new TableField[] {Contribution.CONTRIBUTION.EHR_ID, Contribution.CONTRIBUTION.SYS_TENANT}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID, Ehr.EHR_.SYS_TENANT}, + true); + public static final ForeignKey CONTRIBUTION__CONTRIBUTION_HAS_AUDIT_FKEY = + Internal.createForeignKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_has_audit_fkey"), + new TableField[] {Contribution.CONTRIBUTION.HAS_AUDIT, Contribution.CONTRIBUTION.SYS_TENANT}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final ForeignKey CONTRIBUTION__CONTRIBUTION_SYS_TENANT_FKEY = + Internal.createForeignKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_sys_tenant_fkey"), + new TableField[] {Contribution.CONTRIBUTION.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey EHR__EHR_ACCESS_FKEY = Internal.createForeignKey( + Ehr.EHR_, + DSL.name("ehr_access_fkey"), + new TableField[] {Ehr.EHR_.ACCESS, Ehr.EHR_.SYS_TENANT}, + Keys.ACCESS_PKEY, + new TableField[] {Access.ACCESS.ID, Access.ACCESS.SYS_TENANT}, + true); + public static final ForeignKey EHR__EHR_SYS_TENANT_FKEY = Internal.createForeignKey( + Ehr.EHR_, + DSL.name("ehr_sys_tenant_fkey"), + new TableField[] {Ehr.EHR_.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey EHR__EHR_SYSTEM_ID_FKEY = Internal.createForeignKey( + Ehr.EHR_, + DSL.name("ehr_system_id_fkey"), + new TableField[] {Ehr.EHR_.SYSTEM_ID}, + Keys.SYSTEM_PKEY, + new TableField[] {System.SYSTEM.ID}, + true); + public static final ForeignKey EHR_FOLDER__EHR_FOLDER_AUDIT_ID_FKEY = + Internal.createForeignKey( + EhrFolder.EHR_FOLDER, + DSL.name("ehr_folder_audit_id_fkey"), + new TableField[] {EhrFolder.EHR_FOLDER.AUDIT_ID, EhrFolder.EHR_FOLDER.SYS_TENANT}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final ForeignKey EHR_FOLDER__EHR_FOLDER_CONTRIBUTION_ID_FKEY = + Internal.createForeignKey( + EhrFolder.EHR_FOLDER, + DSL.name("ehr_folder_contribution_id_fkey"), + new TableField[] {EhrFolder.EHR_FOLDER.CONTRIBUTION_ID, EhrFolder.EHR_FOLDER.SYS_TENANT}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID, Contribution.CONTRIBUTION.SYS_TENANT}, + true); + public static final ForeignKey EHR_FOLDER__EHR_FOLDER_EHR_ID_FKEY = + Internal.createForeignKey( + EhrFolder.EHR_FOLDER, + DSL.name("ehr_folder_ehr_id_fkey"), + new TableField[] {EhrFolder.EHR_FOLDER.EHR_ID, EhrFolder.EHR_FOLDER.SYS_TENANT}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID, Ehr.EHR_.SYS_TENANT}, + true); + public static final ForeignKey EHR_FOLDER__EHR_FOLDER_SYS_TENANT_FKEY = + Internal.createForeignKey( + EhrFolder.EHR_FOLDER, + DSL.name("ehr_folder_sys_tenant_fkey"), + new TableField[] {EhrFolder.EHR_FOLDER.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_AUDIT_ID_FKEY = Internal.createForeignKey( + EhrFolderHistory.EHR_FOLDER_HISTORY, + DSL.name("ehr_folder_history_audit_id_fkey"), + new TableField[] { + EhrFolderHistory.EHR_FOLDER_HISTORY.AUDIT_ID, EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_TENANT + }, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final ForeignKey + EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + EhrFolderHistory.EHR_FOLDER_HISTORY, + DSL.name("ehr_folder_history_contribution_id_fkey"), + new TableField[] { + EhrFolderHistory.EHR_FOLDER_HISTORY.CONTRIBUTION_ID, + EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_TENANT + }, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID, Contribution.CONTRIBUTION.SYS_TENANT}, + true); + public static final ForeignKey + EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_EHR_ID_FKEY = Internal.createForeignKey( + EhrFolderHistory.EHR_FOLDER_HISTORY, + DSL.name("ehr_folder_history_ehr_id_fkey"), + new TableField[] { + EhrFolderHistory.EHR_FOLDER_HISTORY.EHR_ID, EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_TENANT + }, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID, Ehr.EHR_.SYS_TENANT}, + true); + public static final ForeignKey + EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_SYS_TENANT_FKEY = Internal.createForeignKey( + EhrFolderHistory.EHR_FOLDER_HISTORY, + DSL.name("ehr_folder_history_sys_tenant_fkey"), + new TableField[] {EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey ENTRY__ENTRY_COMPOSITION_ID_FKEY = + Internal.createForeignKey( + Entry.ENTRY, + DSL.name("entry_composition_id_fkey"), + new TableField[] {Entry.ENTRY.COMPOSITION_ID, Entry.ENTRY.SYS_TENANT}, + Keys.COMPOSITION_PKEY, + new TableField[] {Composition.COMPOSITION.ID, Composition.COMPOSITION.SYS_TENANT}, + true); + public static final ForeignKey ENTRY__ENTRY_SYS_TENANT_FKEY = Internal.createForeignKey( + Entry.ENTRY, + DSL.name("entry_sys_tenant_fkey"), + new TableField[] {Entry.ENTRY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey ENTRY_HISTORY__ENTRY_HISTORY_SYS_TENANT_FKEY = + Internal.createForeignKey( + EntryHistory.ENTRY_HISTORY, + DSL.name("entry_history_sys_tenant_fkey"), + new TableField[] {EntryHistory.ENTRY_HISTORY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + EVENT_CONTEXT__EVENT_CONTEXT_COMPOSITION_ID_FKEY = Internal.createForeignKey( + EventContext.EVENT_CONTEXT, + DSL.name("event_context_composition_id_fkey"), + new TableField[] {EventContext.EVENT_CONTEXT.COMPOSITION_ID, EventContext.EVENT_CONTEXT.SYS_TENANT}, + Keys.COMPOSITION_PKEY, + new TableField[] {Composition.COMPOSITION.ID, Composition.COMPOSITION.SYS_TENANT}, + true); + public static final ForeignKey + EVENT_CONTEXT__EVENT_CONTEXT_FACILITY_FKEY = Internal.createForeignKey( + EventContext.EVENT_CONTEXT, + DSL.name("event_context_facility_fkey"), + new TableField[] {EventContext.EVENT_CONTEXT.FACILITY, EventContext.EVENT_CONTEXT.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey EVENT_CONTEXT__EVENT_CONTEXT_SYS_TENANT_FKEY = + Internal.createForeignKey( + EventContext.EVENT_CONTEXT, + DSL.name("event_context_sys_tenant_fkey"), + new TableField[] {EventContext.EVENT_CONTEXT.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + EVENT_CONTEXT_HISTORY__EVENT_CONTEXT_HISTORY_SYS_TENANT_FKEY = Internal.createForeignKey( + EventContextHistory.EVENT_CONTEXT_HISTORY, + DSL.name("event_context_history_sys_tenant_fkey"), + new TableField[] {EventContextHistory.EVENT_CONTEXT_HISTORY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey HEADING__HEADING_SYS_TENANT_FKEY = + Internal.createForeignKey( + Heading.HEADING, + DSL.name("heading_sys_tenant_fkey"), + new TableField[] {Heading.HEADING.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey IDENTIFIER__IDENTIFIER_PARTY_FKEY = + Internal.createForeignKey( + Identifier.IDENTIFIER, + DSL.name("identifier_party_fkey"), + new TableField[] {Identifier.IDENTIFIER.PARTY, Identifier.IDENTIFIER.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey IDENTIFIER__IDENTIFIER_SYS_TENANT_FKEY = + Internal.createForeignKey( + Identifier.IDENTIFIER, + DSL.name("identifier_sys_tenant_fkey"), + new TableField[] {Identifier.IDENTIFIER.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + PARTICIPATION__PARTICIPATION_EVENT_CONTEXT_FKEY = Internal.createForeignKey( + Participation.PARTICIPATION, + DSL.name("participation_event_context_fkey"), + new TableField[] {Participation.PARTICIPATION.EVENT_CONTEXT, Participation.PARTICIPATION.SYS_TENANT + }, + Keys.EVENT_CONTEXT_PKEY, + new TableField[] {EventContext.EVENT_CONTEXT.ID, EventContext.EVENT_CONTEXT.SYS_TENANT}, + true); + public static final ForeignKey + PARTICIPATION__PARTICIPATION_PERFORMER_FKEY = Internal.createForeignKey( + Participation.PARTICIPATION, + DSL.name("participation_performer_fkey"), + new TableField[] {Participation.PARTICIPATION.PERFORMER, Participation.PARTICIPATION.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey PARTICIPATION__PARTICIPATION_SYS_TENANT_FKEY = + Internal.createForeignKey( + Participation.PARTICIPATION, + DSL.name("participation_sys_tenant_fkey"), + new TableField[] {Participation.PARTICIPATION.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + PARTICIPATION_HISTORY__PARTICIPATION_HISTORY_SYS_TENANT_FKEY = Internal.createForeignKey( + ParticipationHistory.PARTICIPATION_HISTORY, + DSL.name("participation_history_sys_tenant_fkey"), + new TableField[] {ParticipationHistory.PARTICIPATION_HISTORY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + PARTY_IDENTIFIED__PARTY_IDENTIFIED_SYS_TENANT_FKEY = Internal.createForeignKey( + PartyIdentified.PARTY_IDENTIFIED, + DSL.name("party_identified_sys_tenant_fkey"), + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey SESSION_LOG__SESSION_LOG_SYS_TENANT_FKEY = + Internal.createForeignKey( + SessionLog.SESSION_LOG, + DSL.name("session_log_sys_tenant_fkey"), + new TableField[] {SessionLog.SESSION_LOG.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey STATUS__STATUS_ATTESTATION_REF_FKEY = + Internal.createForeignKey( + Status.STATUS, + DSL.name("status_attestation_ref_fkey"), + new TableField[] {Status.STATUS.ATTESTATION_REF, Status.STATUS.SYS_TENANT}, + Keys.ATTESTATION_REF_PKEY, + new TableField[] {AttestationRef.ATTESTATION_REF.REF, AttestationRef.ATTESTATION_REF.SYS_TENANT}, + true); + public static final ForeignKey STATUS__STATUS_EHR_ID_FKEY = Internal.createForeignKey( + Status.STATUS, + DSL.name("status_ehr_id_fkey"), + new TableField[] {Status.STATUS.EHR_ID, Status.STATUS.SYS_TENANT}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID, Ehr.EHR_.SYS_TENANT}, + true); + public static final ForeignKey STATUS__STATUS_HAS_AUDIT_FKEY = + Internal.createForeignKey( + Status.STATUS, + DSL.name("status_has_audit_fkey"), + new TableField[] {Status.STATUS.HAS_AUDIT, Status.STATUS.SYS_TENANT}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID, AuditDetails.AUDIT_DETAILS.SYS_TENANT}, + true); + public static final ForeignKey STATUS__STATUS_IN_CONTRIBUTION_FKEY = + Internal.createForeignKey( + Status.STATUS, + DSL.name("status_in_contribution_fkey"), + new TableField[] {Status.STATUS.IN_CONTRIBUTION, Status.STATUS.SYS_TENANT}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID, Contribution.CONTRIBUTION.SYS_TENANT}, + true); + public static final ForeignKey STATUS__STATUS_PARTY_FKEY = + Internal.createForeignKey( + Status.STATUS, + DSL.name("status_party_fkey"), + new TableField[] {Status.STATUS.PARTY, Status.STATUS.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey STATUS__STATUS_SYS_TENANT_FKEY = + Internal.createForeignKey( + Status.STATUS, + DSL.name("status_sys_tenant_fkey"), + new TableField[] {Status.STATUS.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey STATUS_HISTORY__STATUS_HISTORY_SYS_TENANT_FKEY = + Internal.createForeignKey( + StatusHistory.STATUS_HISTORY, + DSL.name("status_history_sys_tenant_fkey"), + new TableField[] {StatusHistory.STATUS_HISTORY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey STORED_QUERY__STORED_QUERY_SYS_TENANT_FKEY = + Internal.createForeignKey( + StoredQuery.STORED_QUERY, + DSL.name("stored_query_sys_tenant_fkey"), + new TableField[] {StoredQuery.STORED_QUERY.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey TEMPLATE_STORE__TEMPLATE_STORE_SYS_TENANT_FKEY = + Internal.createForeignKey( + TemplateStore.TEMPLATE_STORE, + DSL.name("template_store_sys_tenant_fkey"), + new TableField[] {TemplateStore.TEMPLATE_STORE.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey + TERMINOLOGY_PROVIDER__TERMINOLOGY_PROVIDER_SYS_TENANT_FKEY = Internal.createForeignKey( + TerminologyProvider.TERMINOLOGY_PROVIDER, + DSL.name("terminology_provider_sys_tenant_fkey"), + new TableField[] {TerminologyProvider.TERMINOLOGY_PROVIDER.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); + public static final ForeignKey USERS__USERS_PARTY_ID_FKEY = + Internal.createForeignKey( + Users.USERS, + DSL.name("users_party_id_fkey"), + new TableField[] {Users.USERS.PARTY_ID, Users.USERS.SYS_TENANT}, + Keys.PARTY_IDENTIFIED_PKEY, + new TableField[] {PartyIdentified.PARTY_IDENTIFIED.ID, PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT}, + true); + public static final ForeignKey USERS__USERS_SYS_TENANT_FKEY = Internal.createForeignKey( + Users.USERS, + DSL.name("users_sys_tenant_fkey"), + new TableField[] {Users.USERS.SYS_TENANT}, + Keys.TENANT_PKEY, + new TableField[] {Tenant.TENANT.ID}, + true); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Routines.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Routines.java new file mode 100644 index 0000000..7edfd3a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Routines.java @@ -0,0 +1,3169 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import java.sql.Timestamp; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.AdminDeleteAllTemplates; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.AdminDeleteTemplate; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.AdminUpdateTemplate; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.AqlNodeNamePredicate; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.CamelToSnake; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.CompositionName; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.CompositionUid; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.DeleteOrphanHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.EhrStatusUid; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.FolderUid; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.GetSystemVersion; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.IsoTimestamp; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsArchetypeDetails1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsArchetypeDetails2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsArchetyped; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsAuditDetails; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalDvQuantity; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalGenericId; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalHierObjectId1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalHierObjectId2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalObjectId; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalObjectVersionId; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalParticipations; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalPartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCanonicalPartyRef; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCodePhrase1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsCodePhrase2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsComposition1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsComposition2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsConcept; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsContext; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsContextSetting; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsContribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsDvCodedText1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsDvCodedText2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsDvCodedTextInner1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsDvCodedTextInner2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsDvDateTime; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsDvText; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsEhr; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsEhrStatus1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsEhrStatus2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsEhrStatusUid; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsFolder; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsObjectVersionId; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsParticipations; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsParty; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsPartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsPartyRef; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsPartySelf; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsPartySelfIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsTermMappings; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsTypedElementValue; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonEntryMigrate; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonPartyIdentified1; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonPartyIdentified2; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonPartyRelated; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonPartySelf; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonbExtractPath; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.JsonbExtractPathText; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MapChangeTypeToCodestring; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrateConceptToDvCodedText; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrateFolderAudit; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrateParticipationFunction; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrateParticipationMode; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrationAuditCommitter; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrationAuditSystemId; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.MigrationAuditTzid; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.NextSysTenant; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.ObjectVersionId; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.PartyRef; +import org.ehrbase.migration.exporter.v0.jooq.pg.routines.PartyUsage; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAttestationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAuditRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteContributionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrFullRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEventContextForCompoRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteTenantFullRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsForContribRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedContributionsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedStatusForContribRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetTemplateUsageRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.JsonbArrayElementsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyUsageIdentificationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.XjsonbArrayElementsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.CodePhraseRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.JSONB; +import org.jooq.Result; + +/** + * Convenience access to all stored procedures and functions in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Routines { + + /** + * Call ehr.admin_delete_all_templates + */ + public static Integer adminDeleteAllTemplates(Configuration configuration) { + AdminDeleteAllTemplates f = new AdminDeleteAllTemplates(); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.admin_delete_all_templates as a field. + */ + public static Field adminDeleteAllTemplates() { + AdminDeleteAllTemplates f = new AdminDeleteAllTemplates(); + + return f.asField(); + } + + /** + * Call ehr.admin_delete_template + */ + public static Integer adminDeleteTemplate(Configuration configuration, String targetId) { + AdminDeleteTemplate f = new AdminDeleteTemplate(); + f.setTargetId(targetId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.admin_delete_template as a field. + */ + public static Field adminDeleteTemplate(String targetId) { + AdminDeleteTemplate f = new AdminDeleteTemplate(); + f.setTargetId(targetId); + + return f.asField(); + } + + /** + * Get ehr.admin_delete_template as a field. + */ + public static Field adminDeleteTemplate(Field targetId) { + AdminDeleteTemplate f = new AdminDeleteTemplate(); + f.setTargetId(targetId); + + return f.asField(); + } + + /** + * Call ehr.admin_update_template + */ + public static String adminUpdateTemplate(Configuration configuration, String targetId, String updateContent) { + AdminUpdateTemplate f = new AdminUpdateTemplate(); + f.setTargetId(targetId); + f.setUpdateContent(updateContent); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.admin_update_template as a field. + */ + public static Field adminUpdateTemplate(String targetId, String updateContent) { + AdminUpdateTemplate f = new AdminUpdateTemplate(); + f.setTargetId(targetId); + f.setUpdateContent(updateContent); + + return f.asField(); + } + + /** + * Get ehr.admin_update_template as a field. + */ + public static Field adminUpdateTemplate(Field targetId, Field updateContent) { + AdminUpdateTemplate f = new AdminUpdateTemplate(); + f.setTargetId(targetId); + f.setUpdateContent(updateContent); + + return f.asField(); + } + + /** + * Call ehr.aql_node_name_predicate + */ + public static JSONB aqlNodeNamePredicate( + Configuration configuration, JSONB entry, String nameValuePredicate, String jsonbPath) { + AqlNodeNamePredicate f = new AqlNodeNamePredicate(); + f.setEntry(entry); + f.setNameValuePredicate(nameValuePredicate); + f.setJsonbPath(jsonbPath); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.aql_node_name_predicate as a field. + */ + public static Field aqlNodeNamePredicate(JSONB entry, String nameValuePredicate, String jsonbPath) { + AqlNodeNamePredicate f = new AqlNodeNamePredicate(); + f.setEntry(entry); + f.setNameValuePredicate(nameValuePredicate); + f.setJsonbPath(jsonbPath); + + return f.asField(); + } + + /** + * Get ehr.aql_node_name_predicate as a field. + */ + public static Field aqlNodeNamePredicate( + Field entry, Field nameValuePredicate, Field jsonbPath) { + AqlNodeNamePredicate f = new AqlNodeNamePredicate(); + f.setEntry(entry); + f.setNameValuePredicate(nameValuePredicate); + f.setJsonbPath(jsonbPath); + + return f.asField(); + } + + /** + * Call ehr.camel_to_snake + */ + public static String camelToSnake(Configuration configuration, String literal) { + CamelToSnake f = new CamelToSnake(); + f.setLiteral(literal); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.camel_to_snake as a field. + */ + public static Field camelToSnake(String literal) { + CamelToSnake f = new CamelToSnake(); + f.setLiteral(literal); + + return f.asField(); + } + + /** + * Get ehr.camel_to_snake as a field. + */ + public static Field camelToSnake(Field literal) { + CamelToSnake f = new CamelToSnake(); + f.setLiteral(literal); + + return f.asField(); + } + + /** + * Call ehr.composition_name + */ + public static String compositionName(Configuration configuration, JSONB content) { + CompositionName f = new CompositionName(); + f.setContent(content); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.composition_name as a field. + */ + public static Field compositionName(JSONB content) { + CompositionName f = new CompositionName(); + f.setContent(content); + + return f.asField(); + } + + /** + * Get ehr.composition_name as a field. + */ + public static Field compositionName(Field content) { + CompositionName f = new CompositionName(); + f.setContent(content); + + return f.asField(); + } + + /** + * Call ehr.composition_uid + */ + public static String compositionUid(Configuration configuration, UUID compositionUid, String serverId) { + CompositionUid f = new CompositionUid(); + f.setCompositionUid(compositionUid); + f.setServerId(serverId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.composition_uid as a field. + */ + public static Field compositionUid(UUID compositionUid, String serverId) { + CompositionUid f = new CompositionUid(); + f.setCompositionUid(compositionUid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Get ehr.composition_uid as a field. + */ + public static Field compositionUid(Field compositionUid, Field serverId) { + CompositionUid f = new CompositionUid(); + f.setCompositionUid(compositionUid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Call ehr.delete_orphan_history + */ + public static Boolean deleteOrphanHistory(Configuration configuration) { + DeleteOrphanHistory f = new DeleteOrphanHistory(); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.delete_orphan_history as a field. + */ + public static Field deleteOrphanHistory() { + DeleteOrphanHistory f = new DeleteOrphanHistory(); + + return f.asField(); + } + + /** + * Call ehr.ehr_status_uid + */ + public static String ehrStatusUid(Configuration configuration, UUID ehrUuid, String serverId) { + EhrStatusUid f = new EhrStatusUid(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.ehr_status_uid as a field. + */ + public static Field ehrStatusUid(UUID ehrUuid, String serverId) { + EhrStatusUid f = new EhrStatusUid(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Get ehr.ehr_status_uid as a field. + */ + public static Field ehrStatusUid(Field ehrUuid, Field serverId) { + EhrStatusUid f = new EhrStatusUid(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Call ehr.folder_uid + */ + public static String folderUid(Configuration configuration, UUID folderUid, String serverId) { + FolderUid f = new FolderUid(); + f.setFolderUid(folderUid); + f.setServerId(serverId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.folder_uid as a field. + */ + public static Field folderUid(UUID folderUid, String serverId) { + FolderUid f = new FolderUid(); + f.setFolderUid(folderUid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Get ehr.folder_uid as a field. + */ + public static Field folderUid(Field folderUid, Field serverId) { + FolderUid f = new FolderUid(); + f.setFolderUid(folderUid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Call ehr.get_system_version + */ + public static String getSystemVersion(Configuration configuration) { + GetSystemVersion f = new GetSystemVersion(); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.get_system_version as a field. + */ + public static Field getSystemVersion() { + GetSystemVersion f = new GetSystemVersion(); + + return f.asField(); + } + + /** + * Call ehr.iso_timestamp + */ + public static String isoTimestamp(Configuration configuration, OffsetDateTime __1) { + IsoTimestamp f = new IsoTimestamp(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.iso_timestamp as a field. + */ + public static Field isoTimestamp(OffsetDateTime __1) { + IsoTimestamp f = new IsoTimestamp(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.iso_timestamp as a field. + */ + public static Field isoTimestamp(Field __1) { + IsoTimestamp f = new IsoTimestamp(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_archetype_details + */ + public static JSONB jsArchetypeDetails1(Configuration configuration, String archetypeNodeId, String templateId) { + JsArchetypeDetails1 f = new JsArchetypeDetails1(); + f.setArchetypeNodeId(archetypeNodeId); + f.setTemplateId(templateId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_archetype_details as a field. + */ + public static Field jsArchetypeDetails1(String archetypeNodeId, String templateId) { + JsArchetypeDetails1 f = new JsArchetypeDetails1(); + f.setArchetypeNodeId(archetypeNodeId); + f.setTemplateId(templateId); + + return f.asField(); + } + + /** + * Get ehr.js_archetype_details as a field. + */ + public static Field jsArchetypeDetails1(Field archetypeNodeId, Field templateId) { + JsArchetypeDetails1 f = new JsArchetypeDetails1(); + f.setArchetypeNodeId(archetypeNodeId); + f.setTemplateId(templateId); + + return f.asField(); + } + + /** + * Call ehr.js_archetype_details + */ + public static JSONB jsArchetypeDetails2( + Configuration configuration, String archetypeNodeId, String templateId, String rmVersion) { + JsArchetypeDetails2 f = new JsArchetypeDetails2(); + f.setArchetypeNodeId(archetypeNodeId); + f.setTemplateId(templateId); + f.setRmVersion(rmVersion); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_archetype_details as a field. + */ + public static Field jsArchetypeDetails2(String archetypeNodeId, String templateId, String rmVersion) { + JsArchetypeDetails2 f = new JsArchetypeDetails2(); + f.setArchetypeNodeId(archetypeNodeId); + f.setTemplateId(templateId); + f.setRmVersion(rmVersion); + + return f.asField(); + } + + /** + * Get ehr.js_archetype_details as a field. + */ + public static Field jsArchetypeDetails2( + Field archetypeNodeId, Field templateId, Field rmVersion) { + JsArchetypeDetails2 f = new JsArchetypeDetails2(); + f.setArchetypeNodeId(archetypeNodeId); + f.setTemplateId(templateId); + f.setRmVersion(rmVersion); + + return f.asField(); + } + + /** + * Call ehr.js_archetyped + */ + public static JSON jsArchetyped(Configuration configuration, String __1, String __2) { + JsArchetyped f = new JsArchetyped(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_archetyped as a field. + */ + public static Field jsArchetyped(String __1, String __2) { + JsArchetyped f = new JsArchetyped(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_archetyped as a field. + */ + public static Field jsArchetyped(Field __1, Field __2) { + JsArchetyped f = new JsArchetyped(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_audit_details + */ + public static JSON jsAuditDetails(Configuration configuration, UUID __1) { + JsAuditDetails f = new JsAuditDetails(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_audit_details as a field. + */ + public static Field jsAuditDetails(UUID __1) { + JsAuditDetails f = new JsAuditDetails(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_audit_details as a field. + */ + public static Field jsAuditDetails(Field __1) { + JsAuditDetails f = new JsAuditDetails(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_dv_quantity + */ + public static JSON jsCanonicalDvQuantity( + Configuration configuration, Double magnitude, String units, Integer _Precision, Boolean accuracyPercent) { + JsCanonicalDvQuantity f = new JsCanonicalDvQuantity(); + f.setMagnitude(magnitude); + f.setUnits(units); + f.set_Precision(_Precision); + f.setAccuracyPercent(accuracyPercent); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_dv_quantity as a field. + */ + public static Field jsCanonicalDvQuantity( + Double magnitude, String units, Integer _Precision, Boolean accuracyPercent) { + JsCanonicalDvQuantity f = new JsCanonicalDvQuantity(); + f.setMagnitude(magnitude); + f.setUnits(units); + f.set_Precision(_Precision); + f.setAccuracyPercent(accuracyPercent); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_dv_quantity as a field. + */ + public static Field jsCanonicalDvQuantity( + Field magnitude, Field units, Field _Precision, Field accuracyPercent) { + JsCanonicalDvQuantity f = new JsCanonicalDvQuantity(); + f.setMagnitude(magnitude); + f.setUnits(units); + f.set_Precision(_Precision); + f.setAccuracyPercent(accuracyPercent); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_generic_id + */ + public static JSON jsCanonicalGenericId(Configuration configuration, String scheme, String idValue) { + JsCanonicalGenericId f = new JsCanonicalGenericId(); + f.setScheme(scheme); + f.setIdValue(idValue); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_generic_id as a field. + */ + public static Field jsCanonicalGenericId(String scheme, String idValue) { + JsCanonicalGenericId f = new JsCanonicalGenericId(); + f.setScheme(scheme); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_generic_id as a field. + */ + public static Field jsCanonicalGenericId(Field scheme, Field idValue) { + JsCanonicalGenericId f = new JsCanonicalGenericId(); + f.setScheme(scheme); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_hier_object_id + */ + public static JSON jsCanonicalHierObjectId1(Configuration configuration, UUID ehrId) { + JsCanonicalHierObjectId1 f = new JsCanonicalHierObjectId1(); + f.setEhrId(ehrId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_hier_object_id as a field. + */ + public static Field jsCanonicalHierObjectId1(UUID ehrId) { + JsCanonicalHierObjectId1 f = new JsCanonicalHierObjectId1(); + f.setEhrId(ehrId); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_hier_object_id as a field. + */ + public static Field jsCanonicalHierObjectId1(Field ehrId) { + JsCanonicalHierObjectId1 f = new JsCanonicalHierObjectId1(); + f.setEhrId(ehrId); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_hier_object_id + */ + public static JSON jsCanonicalHierObjectId2(Configuration configuration, String idValue) { + JsCanonicalHierObjectId2 f = new JsCanonicalHierObjectId2(); + f.setIdValue(idValue); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_hier_object_id as a field. + */ + public static Field jsCanonicalHierObjectId2(String idValue) { + JsCanonicalHierObjectId2 f = new JsCanonicalHierObjectId2(); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_hier_object_id as a field. + */ + public static Field jsCanonicalHierObjectId2(Field idValue) { + JsCanonicalHierObjectId2 f = new JsCanonicalHierObjectId2(); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_object_id + */ + public static JSON jsCanonicalObjectId( + Configuration configuration, PartyRefIdType objectidType, String scheme, String idValue) { + JsCanonicalObjectId f = new JsCanonicalObjectId(); + f.setObjectidType(objectidType); + f.setScheme(scheme); + f.setIdValue(idValue); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_object_id as a field. + */ + public static Field jsCanonicalObjectId(PartyRefIdType objectidType, String scheme, String idValue) { + JsCanonicalObjectId f = new JsCanonicalObjectId(); + f.setObjectidType(objectidType); + f.setScheme(scheme); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_object_id as a field. + */ + public static Field jsCanonicalObjectId( + Field objectidType, Field scheme, Field idValue) { + JsCanonicalObjectId f = new JsCanonicalObjectId(); + f.setObjectidType(objectidType); + f.setScheme(scheme); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_object_version_id + */ + public static JSON jsCanonicalObjectVersionId(Configuration configuration, String idValue) { + JsCanonicalObjectVersionId f = new JsCanonicalObjectVersionId(); + f.setIdValue(idValue); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_object_version_id as a field. + */ + public static Field jsCanonicalObjectVersionId(String idValue) { + JsCanonicalObjectVersionId f = new JsCanonicalObjectVersionId(); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_object_version_id as a field. + */ + public static Field jsCanonicalObjectVersionId(Field idValue) { + JsCanonicalObjectVersionId f = new JsCanonicalObjectVersionId(); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_participations + */ + public static JSON jsCanonicalParticipations(Configuration configuration, UUID contextId) { + JsCanonicalParticipations f = new JsCanonicalParticipations(); + f.setContextId(contextId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_participations as a field. + */ + public static Field jsCanonicalParticipations(UUID contextId) { + JsCanonicalParticipations f = new JsCanonicalParticipations(); + f.setContextId(contextId); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_participations as a field. + */ + public static Field jsCanonicalParticipations(Field contextId) { + JsCanonicalParticipations f = new JsCanonicalParticipations(); + f.setContextId(contextId); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_party_identified + */ + public static JSON jsCanonicalPartyIdentified(Configuration configuration, UUID refid) { + JsCanonicalPartyIdentified f = new JsCanonicalPartyIdentified(); + f.setRefid(refid); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_party_identified as a field. + */ + public static Field jsCanonicalPartyIdentified(UUID refid) { + JsCanonicalPartyIdentified f = new JsCanonicalPartyIdentified(); + f.setRefid(refid); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_party_identified as a field. + */ + public static Field jsCanonicalPartyIdentified(Field refid) { + JsCanonicalPartyIdentified f = new JsCanonicalPartyIdentified(); + f.setRefid(refid); + + return f.asField(); + } + + /** + * Call ehr.js_canonical_party_ref + */ + public static JSON jsCanonicalPartyRef( + Configuration configuration, String namespace, String type, String scheme, String id) { + JsCanonicalPartyRef f = new JsCanonicalPartyRef(); + f.setNamespace(namespace); + f.setType(type); + f.setScheme(scheme); + f.setId(id); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_canonical_party_ref as a field. + */ + public static Field jsCanonicalPartyRef(String namespace, String type, String scheme, String id) { + JsCanonicalPartyRef f = new JsCanonicalPartyRef(); + f.setNamespace(namespace); + f.setType(type); + f.setScheme(scheme); + f.setId(id); + + return f.asField(); + } + + /** + * Get ehr.js_canonical_party_ref as a field. + */ + public static Field jsCanonicalPartyRef( + Field namespace, Field type, Field scheme, Field id) { + JsCanonicalPartyRef f = new JsCanonicalPartyRef(); + f.setNamespace(namespace); + f.setType(type); + f.setScheme(scheme); + f.setId(id); + + return f.asField(); + } + + /** + * Call ehr.js_code_phrase + */ + public static JSON jsCodePhrase1(Configuration configuration, String __1, String __2) { + JsCodePhrase1 f = new JsCodePhrase1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_code_phrase as a field. + */ + public static Field jsCodePhrase1(String __1, String __2) { + JsCodePhrase1 f = new JsCodePhrase1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_code_phrase as a field. + */ + public static Field jsCodePhrase1(Field __1, Field __2) { + JsCodePhrase1 f = new JsCodePhrase1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_code_phrase + */ + public static JSON jsCodePhrase2(Configuration configuration, CodePhraseRecord codephrase) { + JsCodePhrase2 f = new JsCodePhrase2(); + f.setCodephrase(codephrase); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_code_phrase as a field. + */ + public static Field jsCodePhrase2(CodePhraseRecord codephrase) { + JsCodePhrase2 f = new JsCodePhrase2(); + f.setCodephrase(codephrase); + + return f.asField(); + } + + /** + * Get ehr.js_code_phrase as a field. + */ + public static Field jsCodePhrase2(Field codephrase) { + JsCodePhrase2 f = new JsCodePhrase2(); + f.setCodephrase(codephrase); + + return f.asField(); + } + + /** + * Call ehr.js_composition + */ + public static JSON jsComposition1(Configuration configuration, UUID __1) { + JsComposition1 f = new JsComposition1(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_composition as a field. + */ + public static Field jsComposition1(UUID __1) { + JsComposition1 f = new JsComposition1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_composition as a field. + */ + public static Field jsComposition1(Field __1) { + JsComposition1 f = new JsComposition1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_composition + */ + public static JSON jsComposition2(Configuration configuration, UUID __1, String serverNodeId) { + JsComposition2 f = new JsComposition2(); + f.set__1(__1); + f.setServerNodeId(serverNodeId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_composition as a field. + */ + public static Field jsComposition2(UUID __1, String serverNodeId) { + JsComposition2 f = new JsComposition2(); + f.set__1(__1); + f.setServerNodeId(serverNodeId); + + return f.asField(); + } + + /** + * Get ehr.js_composition as a field. + */ + public static Field jsComposition2(Field __1, Field serverNodeId) { + JsComposition2 f = new JsComposition2(); + f.set__1(__1); + f.setServerNodeId(serverNodeId); + + return f.asField(); + } + + /** + * Call ehr.js_concept + */ + public static JSON jsConcept(Configuration configuration, UUID __1) { + JsConcept f = new JsConcept(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_concept as a field. + */ + public static Field jsConcept(UUID __1) { + JsConcept f = new JsConcept(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_concept as a field. + */ + public static Field jsConcept(Field __1) { + JsConcept f = new JsConcept(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_context + */ + public static JSON jsContext(Configuration configuration, UUID __1) { + JsContext f = new JsContext(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_context as a field. + */ + public static Field jsContext(UUID __1) { + JsContext f = new JsContext(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_context as a field. + */ + public static Field jsContext(Field __1) { + JsContext f = new JsContext(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_context_setting + */ + public static JSON jsContextSetting(Configuration configuration, UUID __1) { + JsContextSetting f = new JsContextSetting(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_context_setting as a field. + */ + public static Field jsContextSetting(UUID __1) { + JsContextSetting f = new JsContextSetting(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_context_setting as a field. + */ + public static Field jsContextSetting(Field __1) { + JsContextSetting f = new JsContextSetting(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_contribution + */ + public static JSON jsContribution(Configuration configuration, UUID __1, String __2) { + JsContribution f = new JsContribution(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_contribution as a field. + */ + public static Field jsContribution(UUID __1, String __2) { + JsContribution f = new JsContribution(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_contribution as a field. + */ + public static Field jsContribution(Field __1, Field __2) { + JsContribution f = new JsContribution(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_dv_coded_text + */ + public static JSON jsDvCodedText1(Configuration configuration, String __1, JSON __2) { + JsDvCodedText1 f = new JsDvCodedText1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_dv_coded_text as a field. + */ + public static Field jsDvCodedText1(String __1, JSON __2) { + JsDvCodedText1 f = new JsDvCodedText1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_dv_coded_text as a field. + */ + public static Field jsDvCodedText1(Field __1, Field __2) { + JsDvCodedText1 f = new JsDvCodedText1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_dv_coded_text + */ + public static JSON jsDvCodedText2(Configuration configuration, DvCodedTextRecord dvcodedtext) { + JsDvCodedText2 f = new JsDvCodedText2(); + f.setDvcodedtext(dvcodedtext); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_dv_coded_text as a field. + */ + public static Field jsDvCodedText2(DvCodedTextRecord dvcodedtext) { + JsDvCodedText2 f = new JsDvCodedText2(); + f.setDvcodedtext(dvcodedtext); + + return f.asField(); + } + + /** + * Get ehr.js_dv_coded_text as a field. + */ + public static Field jsDvCodedText2(Field dvcodedtext) { + JsDvCodedText2 f = new JsDvCodedText2(); + f.setDvcodedtext(dvcodedtext); + + return f.asField(); + } + + /** + * Call ehr.js_dv_coded_text_inner + */ + public static JSON jsDvCodedTextInner1(Configuration configuration, DvCodedTextRecord dvcodedtext) { + JsDvCodedTextInner1 f = new JsDvCodedTextInner1(); + f.setDvcodedtext(dvcodedtext); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_dv_coded_text_inner as a field. + */ + public static Field jsDvCodedTextInner1(DvCodedTextRecord dvcodedtext) { + JsDvCodedTextInner1 f = new JsDvCodedTextInner1(); + f.setDvcodedtext(dvcodedtext); + + return f.asField(); + } + + /** + * Get ehr.js_dv_coded_text_inner as a field. + */ + public static Field jsDvCodedTextInner1(Field dvcodedtext) { + JsDvCodedTextInner1 f = new JsDvCodedTextInner1(); + f.setDvcodedtext(dvcodedtext); + + return f.asField(); + } + + /** + * Call ehr.js_dv_coded_text_inner + */ + public static JSON jsDvCodedTextInner2( + Configuration configuration, String value, String terminologyId, String codeString) { + JsDvCodedTextInner2 f = new JsDvCodedTextInner2(); + f.setValue(value); + f.setTerminologyId(terminologyId); + f.setCodeString(codeString); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_dv_coded_text_inner as a field. + */ + public static Field jsDvCodedTextInner2(String value, String terminologyId, String codeString) { + JsDvCodedTextInner2 f = new JsDvCodedTextInner2(); + f.setValue(value); + f.setTerminologyId(terminologyId); + f.setCodeString(codeString); + + return f.asField(); + } + + /** + * Get ehr.js_dv_coded_text_inner as a field. + */ + public static Field jsDvCodedTextInner2( + Field value, Field terminologyId, Field codeString) { + JsDvCodedTextInner2 f = new JsDvCodedTextInner2(); + f.setValue(value); + f.setTerminologyId(terminologyId); + f.setCodeString(codeString); + + return f.asField(); + } + + /** + * Call ehr.js_dv_date_time + */ + public static JSON jsDvDateTime(Configuration configuration, Timestamp __1, String __2) { + JsDvDateTime f = new JsDvDateTime(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_dv_date_time as a field. + */ + public static Field jsDvDateTime(Timestamp __1, String __2) { + JsDvDateTime f = new JsDvDateTime(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_dv_date_time as a field. + */ + public static Field jsDvDateTime(Field __1, Field __2) { + JsDvDateTime f = new JsDvDateTime(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_dv_text + */ + public static JSON jsDvText(Configuration configuration, String __1) { + JsDvText f = new JsDvText(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_dv_text as a field. + */ + public static Field jsDvText(String __1) { + JsDvText f = new JsDvText(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_dv_text as a field. + */ + public static Field jsDvText(Field __1) { + JsDvText f = new JsDvText(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_ehr + */ + public static JSON jsEhr(Configuration configuration, UUID __1, String __2) { + JsEhr f = new JsEhr(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_ehr as a field. + */ + public static Field jsEhr(UUID __1, String __2) { + JsEhr f = new JsEhr(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_ehr as a field. + */ + public static Field jsEhr(Field __1, Field __2) { + JsEhr f = new JsEhr(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_ehr_status + */ + public static JSON jsEhrStatus1(Configuration configuration, UUID __1) { + JsEhrStatus1 f = new JsEhrStatus1(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_ehr_status as a field. + */ + public static Field jsEhrStatus1(UUID __1) { + JsEhrStatus1 f = new JsEhrStatus1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_ehr_status as a field. + */ + public static Field jsEhrStatus1(Field __1) { + JsEhrStatus1 f = new JsEhrStatus1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_ehr_status + */ + public static JSON jsEhrStatus2(Configuration configuration, UUID ehrUuid, String serverId) { + JsEhrStatus2 f = new JsEhrStatus2(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_ehr_status as a field. + */ + public static Field jsEhrStatus2(UUID ehrUuid, String serverId) { + JsEhrStatus2 f = new JsEhrStatus2(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Get ehr.js_ehr_status as a field. + */ + public static Field jsEhrStatus2(Field ehrUuid, Field serverId) { + JsEhrStatus2 f = new JsEhrStatus2(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Call ehr.js_ehr_status_uid + */ + public static JSONB jsEhrStatusUid(Configuration configuration, UUID ehrUuid, String serverId) { + JsEhrStatusUid f = new JsEhrStatusUid(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_ehr_status_uid as a field. + */ + public static Field jsEhrStatusUid(UUID ehrUuid, String serverId) { + JsEhrStatusUid f = new JsEhrStatusUid(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Get ehr.js_ehr_status_uid as a field. + */ + public static Field jsEhrStatusUid(Field ehrUuid, Field serverId) { + JsEhrStatusUid f = new JsEhrStatusUid(); + f.setEhrUuid(ehrUuid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Call ehr.js_folder + */ + public static JSONB jsFolder(Configuration configuration, UUID folderUid, String serverId) { + JsFolder f = new JsFolder(); + f.setFolderUid(folderUid); + f.setServerId(serverId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_folder as a field. + */ + public static Field jsFolder(UUID folderUid, String serverId) { + JsFolder f = new JsFolder(); + f.setFolderUid(folderUid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Get ehr.js_folder as a field. + */ + public static Field jsFolder(Field folderUid, Field serverId) { + JsFolder f = new JsFolder(); + f.setFolderUid(folderUid); + f.setServerId(serverId); + + return f.asField(); + } + + /** + * Call ehr.js_object_version_id + */ + public static JSONB jsObjectVersionId(Configuration configuration, String versionId) { + JsObjectVersionId f = new JsObjectVersionId(); + f.setVersionId(versionId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_object_version_id as a field. + */ + public static Field jsObjectVersionId(String versionId) { + JsObjectVersionId f = new JsObjectVersionId(); + f.setVersionId(versionId); + + return f.asField(); + } + + /** + * Get ehr.js_object_version_id as a field. + */ + public static Field jsObjectVersionId(Field versionId) { + JsObjectVersionId f = new JsObjectVersionId(); + f.setVersionId(versionId); + + return f.asField(); + } + + /** + * Call ehr.js_participations + */ + public static JSONB[] jsParticipations(Configuration configuration, UUID eventContextId) { + JsParticipations f = new JsParticipations(); + f.setEventContextId(eventContextId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_participations as a field. + */ + public static Field jsParticipations(UUID eventContextId) { + JsParticipations f = new JsParticipations(); + f.setEventContextId(eventContextId); + + return f.asField(); + } + + /** + * Get ehr.js_participations as a field. + */ + public static Field jsParticipations(Field eventContextId) { + JsParticipations f = new JsParticipations(); + f.setEventContextId(eventContextId); + + return f.asField(); + } + + /** + * Call ehr.js_party + */ + public static JSON jsParty(Configuration configuration, UUID __1) { + JsParty f = new JsParty(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_party as a field. + */ + public static Field jsParty(UUID __1) { + JsParty f = new JsParty(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_party as a field. + */ + public static Field jsParty(Field __1) { + JsParty f = new JsParty(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_party_identified + */ + public static JSON jsPartyIdentified(Configuration configuration, String __1, JSON __2) { + JsPartyIdentified f = new JsPartyIdentified(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_party_identified as a field. + */ + public static Field jsPartyIdentified(String __1, JSON __2) { + JsPartyIdentified f = new JsPartyIdentified(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_party_identified as a field. + */ + public static Field jsPartyIdentified(Field __1, Field __2) { + JsPartyIdentified f = new JsPartyIdentified(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_party_ref + */ + public static JSON jsPartyRef(Configuration configuration, String __1, String __2, String __3, String __4) { + JsPartyRef f = new JsPartyRef(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_party_ref as a field. + */ + public static Field jsPartyRef(String __1, String __2, String __3, String __4) { + JsPartyRef f = new JsPartyRef(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Get ehr.js_party_ref as a field. + */ + public static Field jsPartyRef(Field __1, Field __2, Field __3, Field __4) { + JsPartyRef f = new JsPartyRef(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Call ehr.js_party_self + */ + public static JSON jsPartySelf(Configuration configuration, UUID __1) { + JsPartySelf f = new JsPartySelf(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_party_self as a field. + */ + public static Field jsPartySelf(UUID __1) { + JsPartySelf f = new JsPartySelf(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_party_self as a field. + */ + public static Field jsPartySelf(Field __1) { + JsPartySelf f = new JsPartySelf(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.js_party_self_identified + */ + public static JSON jsPartySelfIdentified(Configuration configuration, String __1, JSON __2) { + JsPartySelfIdentified f = new JsPartySelfIdentified(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_party_self_identified as a field. + */ + public static Field jsPartySelfIdentified(String __1, JSON __2) { + JsPartySelfIdentified f = new JsPartySelfIdentified(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get ehr.js_party_self_identified as a field. + */ + public static Field jsPartySelfIdentified(Field __1, Field __2) { + JsPartySelfIdentified f = new JsPartySelfIdentified(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call ehr.js_term_mappings + */ + public static JSONB[] jsTermMappings(Configuration configuration, String[] mappings) { + JsTermMappings f = new JsTermMappings(); + f.setMappings(mappings); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_term_mappings as a field. + */ + public static Field jsTermMappings(String[] mappings) { + JsTermMappings f = new JsTermMappings(); + f.setMappings(mappings); + + return f.asField(); + } + + /** + * Get ehr.js_term_mappings as a field. + */ + public static Field jsTermMappings(Field mappings) { + JsTermMappings f = new JsTermMappings(); + f.setMappings(mappings); + + return f.asField(); + } + + /** + * Call ehr.js_typed_element_value + */ + public static JSONB jsTypedElementValue(Configuration configuration, JSONB __1) { + JsTypedElementValue f = new JsTypedElementValue(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.js_typed_element_value as a field. + */ + public static Field jsTypedElementValue(JSONB __1) { + JsTypedElementValue f = new JsTypedElementValue(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get ehr.js_typed_element_value as a field. + */ + public static Field jsTypedElementValue(Field __1) { + JsTypedElementValue f = new JsTypedElementValue(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call ehr.json_entry_migrate + */ + public static JsonEntryMigrate jsonEntryMigrate(Configuration configuration, JSONB jsonbEntry) { + JsonEntryMigrate p = new JsonEntryMigrate(); + p.setJsonbEntry(jsonbEntry); + + p.execute(configuration); + return p; + } + + /** + * Call ehr.json_party_identified + */ + public static JSON jsonPartyIdentified1( + Configuration configuration, + String name, + UUID refid, + String namespace, + String refType, + String scheme, + String idValue) { + JsonPartyIdentified1 f = new JsonPartyIdentified1(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.json_party_identified as a field. + */ + public static Field jsonPartyIdentified1( + String name, UUID refid, String namespace, String refType, String scheme, String idValue) { + JsonPartyIdentified1 f = new JsonPartyIdentified1(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Get ehr.json_party_identified as a field. + */ + public static Field jsonPartyIdentified1( + Field name, + Field refid, + Field namespace, + Field refType, + Field scheme, + Field idValue) { + JsonPartyIdentified1 f = new JsonPartyIdentified1(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + + return f.asField(); + } + + /** + * Call ehr.json_party_identified + */ + public static JSON jsonPartyIdentified2( + Configuration configuration, + String name, + UUID refid, + String namespace, + String refType, + String scheme, + String idValue, + PartyRefIdType objectidType) { + JsonPartyIdentified2 f = new JsonPartyIdentified2(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.json_party_identified as a field. + */ + public static Field jsonPartyIdentified2( + String name, + UUID refid, + String namespace, + String refType, + String scheme, + String idValue, + PartyRefIdType objectidType) { + JsonPartyIdentified2 f = new JsonPartyIdentified2(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + return f.asField(); + } + + /** + * Get ehr.json_party_identified as a field. + */ + public static Field jsonPartyIdentified2( + Field name, + Field refid, + Field namespace, + Field refType, + Field scheme, + Field idValue, + Field objectidType) { + JsonPartyIdentified2 f = new JsonPartyIdentified2(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + return f.asField(); + } + + /** + * Call ehr.json_party_related + */ + public static JSON jsonPartyRelated( + Configuration configuration, + String name, + UUID refid, + String namespace, + String refType, + String scheme, + String idValue, + PartyRefIdType objectidType, + DvCodedTextRecord relationship) { + JsonPartyRelated f = new JsonPartyRelated(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + f.setRelationship(relationship); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.json_party_related as a field. + */ + public static Field jsonPartyRelated( + String name, + UUID refid, + String namespace, + String refType, + String scheme, + String idValue, + PartyRefIdType objectidType, + DvCodedTextRecord relationship) { + JsonPartyRelated f = new JsonPartyRelated(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + f.setRelationship(relationship); + + return f.asField(); + } + + /** + * Get ehr.json_party_related as a field. + */ + public static Field jsonPartyRelated( + Field name, + Field refid, + Field namespace, + Field refType, + Field scheme, + Field idValue, + Field objectidType, + Field relationship) { + JsonPartyRelated f = new JsonPartyRelated(); + f.setName_(name); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + f.setRelationship(relationship); + + return f.asField(); + } + + /** + * Call ehr.json_party_self + */ + public static JSON jsonPartySelf( + Configuration configuration, + UUID refid, + String namespace, + String refType, + String scheme, + String idValue, + PartyRefIdType objectidType) { + JsonPartySelf f = new JsonPartySelf(); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.json_party_self as a field. + */ + public static Field jsonPartySelf( + UUID refid, String namespace, String refType, String scheme, String idValue, PartyRefIdType objectidType) { + JsonPartySelf f = new JsonPartySelf(); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + return f.asField(); + } + + /** + * Get ehr.json_party_self as a field. + */ + public static Field jsonPartySelf( + Field refid, + Field namespace, + Field refType, + Field scheme, + Field idValue, + Field objectidType) { + JsonPartySelf f = new JsonPartySelf(); + f.setRefid(refid); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + return f.asField(); + } + + /** + * Call ehr.jsonb_extract_path + */ + public static JSONB jsonbExtractPath(Configuration configuration, JSONB fromJson, String[] pathElems) { + JsonbExtractPath f = new JsonbExtractPath(); + f.setFromJson(fromJson); + f.setPathElems(pathElems); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.jsonb_extract_path as a field. + */ + public static Field jsonbExtractPath(JSONB fromJson, String[] pathElems) { + JsonbExtractPath f = new JsonbExtractPath(); + f.setFromJson(fromJson); + f.setPathElems(pathElems); + + return f.asField(); + } + + /** + * Get ehr.jsonb_extract_path as a field. + */ + public static Field jsonbExtractPath(Field fromJson, Field pathElems) { + JsonbExtractPath f = new JsonbExtractPath(); + f.setFromJson(fromJson); + f.setPathElems(pathElems); + + return f.asField(); + } + + /** + * Call ehr.jsonb_extract_path_text + */ + public static String jsonbExtractPathText(Configuration configuration, JSONB fromJson, String[] pathElems) { + JsonbExtractPathText f = new JsonbExtractPathText(); + f.setFromJson(fromJson); + f.setPathElems(pathElems); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.jsonb_extract_path_text as a field. + */ + public static Field jsonbExtractPathText(JSONB fromJson, String[] pathElems) { + JsonbExtractPathText f = new JsonbExtractPathText(); + f.setFromJson(fromJson); + f.setPathElems(pathElems); + + return f.asField(); + } + + /** + * Get ehr.jsonb_extract_path_text as a field. + */ + public static Field jsonbExtractPathText(Field fromJson, Field pathElems) { + JsonbExtractPathText f = new JsonbExtractPathText(); + f.setFromJson(fromJson); + f.setPathElems(pathElems); + + return f.asField(); + } + + /** + * Call ehr.map_change_type_to_codestring + */ + public static String mapChangeTypeToCodestring(Configuration configuration, String literal) { + MapChangeTypeToCodestring f = new MapChangeTypeToCodestring(); + f.setLiteral(literal); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.map_change_type_to_codestring as a field. + */ + public static Field mapChangeTypeToCodestring(String literal) { + MapChangeTypeToCodestring f = new MapChangeTypeToCodestring(); + f.setLiteral(literal); + + return f.asField(); + } + + /** + * Get ehr.map_change_type_to_codestring as a field. + */ + public static Field mapChangeTypeToCodestring(Field literal) { + MapChangeTypeToCodestring f = new MapChangeTypeToCodestring(); + f.setLiteral(literal); + + return f.asField(); + } + + /** + * Call ehr.migrate_concept_to_dv_coded_text + */ + public static DvCodedTextRecord migrateConceptToDvCodedText(Configuration configuration, UUID conceptId) { + MigrateConceptToDvCodedText f = new MigrateConceptToDvCodedText(); + f.setConceptId(conceptId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.migrate_concept_to_dv_coded_text as a field. + */ + public static Field migrateConceptToDvCodedText(UUID conceptId) { + MigrateConceptToDvCodedText f = new MigrateConceptToDvCodedText(); + f.setConceptId(conceptId); + + return f.asField(); + } + + /** + * Get ehr.migrate_concept_to_dv_coded_text as a field. + */ + public static Field migrateConceptToDvCodedText(Field conceptId) { + MigrateConceptToDvCodedText f = new MigrateConceptToDvCodedText(); + f.setConceptId(conceptId); + + return f.asField(); + } + + /** + * Call ehr.migrate_folder_audit + */ + public static UUID migrateFolderAudit(Configuration configuration) { + MigrateFolderAudit p = new MigrateFolderAudit(); + + p.execute(configuration); + return p.getRetId(); + } + + /** + * Call ehr.migrate_participation_function + */ + public static DvCodedTextRecord migrateParticipationFunction(Configuration configuration, String mode) { + MigrateParticipationFunction f = new MigrateParticipationFunction(); + f.setMode(mode); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.migrate_participation_function as a field. + */ + public static Field migrateParticipationFunction(String mode) { + MigrateParticipationFunction f = new MigrateParticipationFunction(); + f.setMode(mode); + + return f.asField(); + } + + /** + * Get ehr.migrate_participation_function as a field. + */ + public static Field migrateParticipationFunction(Field mode) { + MigrateParticipationFunction f = new MigrateParticipationFunction(); + f.setMode(mode); + + return f.asField(); + } + + /** + * Call ehr.migrate_participation_mode + */ + public static DvCodedTextRecord migrateParticipationMode(Configuration configuration, String mode) { + MigrateParticipationMode f = new MigrateParticipationMode(); + f.setMode(mode); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.migrate_participation_mode as a field. + */ + public static Field migrateParticipationMode(String mode) { + MigrateParticipationMode f = new MigrateParticipationMode(); + f.setMode(mode); + + return f.asField(); + } + + /** + * Get ehr.migrate_participation_mode as a field. + */ + public static Field migrateParticipationMode(Field mode) { + MigrateParticipationMode f = new MigrateParticipationMode(); + f.setMode(mode); + + return f.asField(); + } + + /** + * Call ehr.migration_audit_committer + */ + public static UUID migrationAuditCommitter(Configuration configuration, UUID committer) { + MigrationAuditCommitter f = new MigrationAuditCommitter(); + f.setCommitter(committer); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.migration_audit_committer as a field. + */ + public static Field migrationAuditCommitter(UUID committer) { + MigrationAuditCommitter f = new MigrationAuditCommitter(); + f.setCommitter(committer); + + return f.asField(); + } + + /** + * Get ehr.migration_audit_committer as a field. + */ + public static Field migrationAuditCommitter(Field committer) { + MigrationAuditCommitter f = new MigrationAuditCommitter(); + f.setCommitter(committer); + + return f.asField(); + } + + /** + * Call ehr.migration_audit_system_id + */ + public static UUID migrationAuditSystemId(Configuration configuration, UUID systemId) { + MigrationAuditSystemId f = new MigrationAuditSystemId(); + f.setSystemId(systemId); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.migration_audit_system_id as a field. + */ + public static Field migrationAuditSystemId(UUID systemId) { + MigrationAuditSystemId f = new MigrationAuditSystemId(); + f.setSystemId(systemId); + + return f.asField(); + } + + /** + * Get ehr.migration_audit_system_id as a field. + */ + public static Field migrationAuditSystemId(Field systemId) { + MigrationAuditSystemId f = new MigrationAuditSystemId(); + f.setSystemId(systemId); + + return f.asField(); + } + + /** + * Call ehr.migration_audit_tzid + */ + public static String migrationAuditTzid(Configuration configuration, String timeCommittedTzid) { + MigrationAuditTzid f = new MigrationAuditTzid(); + f.setTimeCommittedTzid(timeCommittedTzid); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.migration_audit_tzid as a field. + */ + public static Field migrationAuditTzid(String timeCommittedTzid) { + MigrationAuditTzid f = new MigrationAuditTzid(); + f.setTimeCommittedTzid(timeCommittedTzid); + + return f.asField(); + } + + /** + * Get ehr.migration_audit_tzid as a field. + */ + public static Field migrationAuditTzid(Field timeCommittedTzid) { + MigrationAuditTzid f = new MigrationAuditTzid(); + f.setTimeCommittedTzid(timeCommittedTzid); + + return f.asField(); + } + + /** + * Call ehr.next_sys_tenant + */ + public static Short nextSysTenant(Configuration configuration) { + NextSysTenant f = new NextSysTenant(); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.next_sys_tenant as a field. + */ + public static Field nextSysTenant() { + NextSysTenant f = new NextSysTenant(); + + return f.asField(); + } + + /** + * Call ehr.object_version_id + */ + public static JSON objectVersionId(Configuration configuration, UUID __1, String __2, Integer __3) { + ObjectVersionId f = new ObjectVersionId(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.object_version_id as a field. + */ + public static Field objectVersionId(UUID __1, String __2, Integer __3) { + ObjectVersionId f = new ObjectVersionId(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get ehr.object_version_id as a field. + */ + public static Field objectVersionId(Field __1, Field __2, Field __3) { + ObjectVersionId f = new ObjectVersionId(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call ehr.party_ref + */ + public static JSONB partyRef( + Configuration configuration, + String namespace, + String refType, + String scheme, + String idValue, + PartyRefIdType objectidType) { + PartyRef f = new PartyRef(); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.party_ref as a field. + */ + public static Field partyRef( + String namespace, String refType, String scheme, String idValue, PartyRefIdType objectidType) { + PartyRef f = new PartyRef(); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + return f.asField(); + } + + /** + * Get ehr.party_ref as a field. + */ + public static Field partyRef( + Field namespace, + Field refType, + Field scheme, + Field idValue, + Field objectidType) { + PartyRef f = new PartyRef(); + f.setNamespace(namespace); + f.setRefType(refType); + f.setScheme(scheme); + f.setIdValue(idValue); + f.setObjectidType(objectidType); + + return f.asField(); + } + + /** + * Call ehr.party_usage + */ + public static Long partyUsage(Configuration configuration, UUID partyUuid) { + PartyUsage f = new PartyUsage(); + f.setPartyUuid(partyUuid); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get ehr.party_usage as a field. + */ + public static Field partyUsage(UUID partyUuid) { + PartyUsage f = new PartyUsage(); + f.setPartyUuid(partyUuid); + + return f.asField(); + } + + /** + * Get ehr.party_usage as a field. + */ + public static Field partyUsage(Field partyUuid) { + PartyUsage f = new PartyUsage(); + f.setPartyUuid(partyUuid); + + return f.asField(); + } + + /** + * Call ehr.admin_delete_attestation. + */ + public static Result adminDeleteAttestation( + Configuration configuration, UUID attestRefInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION + .call(attestRefInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_attestation as a table. + */ + public static AdminDeleteAttestation adminDeleteAttestation(UUID attestRefInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.call( + attestRefInput); + } + + /** + * Get ehr.admin_delete_attestation as a table. + */ + public static AdminDeleteAttestation adminDeleteAttestation(Field attestRefInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.call( + attestRefInput); + } + + /** + * Call ehr.admin_delete_audit. + */ + public static Result adminDeleteAudit(Configuration configuration, UUID auditInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call( + auditInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_audit as a table. + */ + public static AdminDeleteAudit adminDeleteAudit(UUID auditInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call(auditInput); + } + + /** + * Get ehr.admin_delete_audit as a table. + */ + public static AdminDeleteAudit adminDeleteAudit(Field auditInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call(auditInput); + } + + /** + * Call ehr.admin_delete_composition. + */ + public static Result adminDeleteComposition( + Configuration configuration, UUID compoIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION + .call(compoIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_composition as a table. + */ + public static AdminDeleteComposition adminDeleteComposition(UUID compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.call( + compoIdInput); + } + + /** + * Get ehr.admin_delete_composition as a table. + */ + public static AdminDeleteComposition adminDeleteComposition(Field compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.call( + compoIdInput); + } + + /** + * Call ehr.admin_delete_composition_history. + */ + public static Result adminDeleteCompositionHistory( + Configuration configuration, UUID compoInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_composition_history as a table. + */ + public static AdminDeleteCompositionHistory adminDeleteCompositionHistory(UUID compoInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput); + } + + /** + * Get ehr.admin_delete_composition_history as a table. + */ + public static AdminDeleteCompositionHistory adminDeleteCompositionHistory(Field compoInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput); + } + + /** + * Call ehr.admin_delete_contribution. + */ + public static Result adminDeleteContribution( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution + .ADMIN_DELETE_CONTRIBUTION + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_contribution as a table. + */ + public static AdminDeleteContribution adminDeleteContribution(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.call( + contribIdInput); + } + + /** + * Get ehr.admin_delete_contribution as a table. + */ + public static AdminDeleteContribution adminDeleteContribution(Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.call( + contribIdInput); + } + + /** + * Call ehr.admin_delete_ehr. + */ + public static Result adminDeleteEhr(Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call( + ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr as a table. + */ + public static AdminDeleteEhr adminDeleteEhr(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call(ehrIdInput); + } + + /** + * Get ehr.admin_delete_ehr as a table. + */ + public static AdminDeleteEhr adminDeleteEhr(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call(ehrIdInput); + } + + /** + * Call ehr.admin_delete_ehr_full. + */ + public static Result adminDeleteEhrFull(Configuration configuration, UUID ehrIdParam) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr_full as a table. + */ + public static AdminDeleteEhrFull adminDeleteEhrFull(UUID ehrIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam); + } + + /** + * Get ehr.admin_delete_ehr_full as a table. + */ + public static AdminDeleteEhrFull adminDeleteEhrFull(Field ehrIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam); + } + + /** + * Call ehr.admin_delete_ehr_history. + */ + public static Result adminDeleteEhrHistory( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr_history as a table. + */ + public static AdminDeleteEhrHistory adminDeleteEhrHistory(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.call( + ehrIdInput); + } + + /** + * Get ehr.admin_delete_ehr_history as a table. + */ + public static AdminDeleteEhrHistory adminDeleteEhrHistory(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.call( + ehrIdInput); + } + + /** + * Call ehr.admin_delete_event_context_for_compo. + */ + public static Result adminDeleteEventContextForCompo( + Configuration configuration, UUID compoIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_event_context_for_compo as a table. + */ + public static AdminDeleteEventContextForCompo adminDeleteEventContextForCompo(UUID compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput); + } + + /** + * Get ehr.admin_delete_event_context_for_compo as a table. + */ + public static AdminDeleteEventContextForCompo adminDeleteEventContextForCompo(Field compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput); + } + + /** + * Call ehr.admin_delete_status. + */ + public static Result adminDeleteStatus(Configuration configuration, UUID statusIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_status as a table. + */ + public static AdminDeleteStatus adminDeleteStatus(UUID statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput); + } + + /** + * Get ehr.admin_delete_status as a table. + */ + public static AdminDeleteStatus adminDeleteStatus(Field statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput); + } + + /** + * Call ehr.admin_delete_status_history. + */ + public static Result adminDeleteStatusHistory( + Configuration configuration, UUID statusIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory + .ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_status_history as a table. + */ + public static AdminDeleteStatusHistory adminDeleteStatusHistory(UUID statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput); + } + + /** + * Get ehr.admin_delete_status_history as a table. + */ + public static AdminDeleteStatusHistory adminDeleteStatusHistory(Field statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput); + } + + /** + * Call ehr.admin_delete_tenant_full. + */ + public static Result adminDeleteTenantFull( + Configuration configuration, Short tenantIdParam) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL + .call(tenantIdParam)) + .fetch(); + } + + /** + * Get ehr.admin_delete_tenant_full as a table. + */ + public static AdminDeleteTenantFull adminDeleteTenantFull(Short tenantIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.call( + tenantIdParam); + } + + /** + * Get ehr.admin_delete_tenant_full as a table. + */ + public static AdminDeleteTenantFull adminDeleteTenantFull(Field tenantIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.call( + tenantIdParam); + } + + /** + * Call ehr.admin_get_linked_compositions. + */ + public static Result adminGetLinkedCompositions( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions + .ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_compositions as a table. + */ + public static AdminGetLinkedCompositions adminGetLinkedCompositions(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput); + } + + /** + * Get ehr.admin_get_linked_compositions as a table. + */ + public static AdminGetLinkedCompositions adminGetLinkedCompositions(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput); + } + + /** + * Call ehr.admin_get_linked_compositions_for_contrib. + */ + public static Result adminGetLinkedCompositionsForContrib( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_compositions_for_contrib as a + * table. + */ + public static AdminGetLinkedCompositionsForContrib adminGetLinkedCompositionsForContrib(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Get ehr.admin_get_linked_compositions_for_contrib as a + * table. + */ + public static AdminGetLinkedCompositionsForContrib adminGetLinkedCompositionsForContrib( + Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Call ehr.admin_get_linked_contributions. + */ + public static Result adminGetLinkedContributions( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_contributions as a table. + */ + public static AdminGetLinkedContributions adminGetLinkedContributions(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput); + } + + /** + * Get ehr.admin_get_linked_contributions as a table. + */ + public static AdminGetLinkedContributions adminGetLinkedContributions(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput); + } + + /** + * Call ehr.admin_get_linked_status_for_contrib. + */ + public static Result adminGetLinkedStatusForContrib( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_status_for_contrib as a table. + */ + public static AdminGetLinkedStatusForContrib adminGetLinkedStatusForContrib(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Get ehr.admin_get_linked_status_for_contrib as a table. + */ + public static AdminGetLinkedStatusForContrib adminGetLinkedStatusForContrib(Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Call ehr.admin_get_template_usage. + */ + public static Result adminGetTemplateUsage( + Configuration configuration, String targetId) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE + .call(targetId)) + .fetch(); + } + + /** + * Get ehr.admin_get_template_usage as a table. + */ + public static AdminGetTemplateUsage adminGetTemplateUsage(String targetId) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.call( + targetId); + } + + /** + * Get ehr.admin_get_template_usage as a table. + */ + public static AdminGetTemplateUsage adminGetTemplateUsage(Field targetId) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.call( + targetId); + } + + /** + * Call ehr.jsonb_array_elements. + */ + public static Result jsonbArrayElements(Configuration configuration, JSONB jsonbVal) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call( + jsonbVal)) + .fetch(); + } + + /** + * Get ehr.jsonb_array_elements as a table. + */ + public static JsonbArrayElements jsonbArrayElements(JSONB jsonbVal) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call(jsonbVal); + } + + /** + * Get ehr.jsonb_array_elements as a table. + */ + public static JsonbArrayElements jsonbArrayElements(Field jsonbVal) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call(jsonbVal); + } + + /** + * Call ehr.party_usage_identification. + */ + public static Result partyUsageIdentification( + Configuration configuration, UUID partyUuid) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification + .PARTY_USAGE_IDENTIFICATION + .call(partyUuid)) + .fetch(); + } + + /** + * Get ehr.party_usage_identification as a table. + */ + public static PartyUsageIdentification partyUsageIdentification(UUID partyUuid) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION + .call(partyUuid); + } + + /** + * Get ehr.party_usage_identification as a table. + */ + public static PartyUsageIdentification partyUsageIdentification(Field partyUuid) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION + .call(partyUuid); + } + + /** + * Call ehr.xjsonb_array_elements. + */ + public static Result xjsonbArrayElements(Configuration configuration, JSONB entry) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call( + entry)) + .fetch(); + } + + /** + * Get ehr.xjsonb_array_elements as a table. + */ + public static XjsonbArrayElements xjsonbArrayElements(JSONB entry) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call(entry); + } + + /** + * Get ehr.xjsonb_array_elements as a table. + */ + public static XjsonbArrayElements xjsonbArrayElements(Field entry) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call(entry); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Sequences.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Sequences.java new file mode 100644 index 0000000..25eb1c0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Sequences.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import org.jooq.Sequence; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * Convenience access to all sequences in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Sequences { + + /** + * The sequence ehr.sys_tenant_seq + */ + public static final Sequence SYS_TENANT_SEQ = Internal.createSequence( + "sys_tenant_seq", Ehr.EHR, SQLDataType.BIGINT.nullable(false), null, null, null, null, false, null); +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Tables.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Tables.java new file mode 100644 index 0000000..0148b77 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/Tables.java @@ -0,0 +1,985 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Access; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Attestation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestationRef; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestedView; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AuditDetails; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompExpand; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompoXref; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Composition; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompositionHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Concept; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Contribution; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolder; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolderHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrStatus; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Entry; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EntryHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContext; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContextHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Heading; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Identifier; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Language; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Participation; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.ParticipationHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Plugin; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.SessionLog; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Status; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StoredQuery; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.System; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Tenant; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TerminologyProvider; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Territory; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Users; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAttestationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAuditRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteContributionRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrFullRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEventContextForCompoRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteTenantFullRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsForContribRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedContributionsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedStatusForContribRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetTemplateUsageRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.JsonbArrayElementsRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyUsageIdentificationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.XjsonbArrayElementsRecord; +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Result; + +/** + * Convenience access to all tables in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Tables { + + /** + * defines the modality for accessing an com.ethercis.ehr (security strategy + * implementation) + */ + public static final Access ACCESS = Access.ACCESS; + + /** + * The table ehr.admin_delete_attestation. + */ + public static final AdminDeleteAttestation ADMIN_DELETE_ATTESTATION = + AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION; + + /** + * Call ehr.admin_delete_attestation. + */ + public static Result ADMIN_DELETE_ATTESTATION( + Configuration configuration, UUID attestRefInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION + .call(attestRefInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_attestation as a table. + */ + public static AdminDeleteAttestation ADMIN_DELETE_ATTESTATION(UUID attestRefInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.call( + attestRefInput); + } + + /** + * Get ehr.admin_delete_attestation as a table. + */ + public static AdminDeleteAttestation ADMIN_DELETE_ATTESTATION(Field attestRefInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.call( + attestRefInput); + } + + /** + * The table ehr.admin_delete_audit. + */ + public static final AdminDeleteAudit ADMIN_DELETE_AUDIT = AdminDeleteAudit.ADMIN_DELETE_AUDIT; + + /** + * Call ehr.admin_delete_audit. + */ + public static Result ADMIN_DELETE_AUDIT(Configuration configuration, UUID auditInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call( + auditInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_audit as a table. + */ + public static AdminDeleteAudit ADMIN_DELETE_AUDIT(UUID auditInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call(auditInput); + } + + /** + * Get ehr.admin_delete_audit as a table. + */ + public static AdminDeleteAudit ADMIN_DELETE_AUDIT(Field auditInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit.ADMIN_DELETE_AUDIT.call(auditInput); + } + + /** + * The table ehr.admin_delete_composition. + */ + public static final AdminDeleteComposition ADMIN_DELETE_COMPOSITION = + AdminDeleteComposition.ADMIN_DELETE_COMPOSITION; + + /** + * Call ehr.admin_delete_composition. + */ + public static Result ADMIN_DELETE_COMPOSITION( + Configuration configuration, UUID compoIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION + .call(compoIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_composition as a table. + */ + public static AdminDeleteComposition ADMIN_DELETE_COMPOSITION(UUID compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.call( + compoIdInput); + } + + /** + * Get ehr.admin_delete_composition as a table. + */ + public static AdminDeleteComposition ADMIN_DELETE_COMPOSITION(Field compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.call( + compoIdInput); + } + + /** + * The table ehr.admin_delete_composition_history. + */ + public static final AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY = + AdminDeleteCompositionHistory.ADMIN_DELETE_COMPOSITION_HISTORY; + + /** + * Call ehr.admin_delete_composition_history. + */ + public static Result ADMIN_DELETE_COMPOSITION_HISTORY( + Configuration configuration, UUID compoInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_composition_history as a table. + */ + public static AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY(UUID compoInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput); + } + + /** + * Get ehr.admin_delete_composition_history as a table. + */ + public static AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY(Field compoInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory + .ADMIN_DELETE_COMPOSITION_HISTORY + .call(compoInput); + } + + /** + * The table ehr.admin_delete_contribution. + */ + public static final AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION = + AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION; + + /** + * Call ehr.admin_delete_contribution. + */ + public static Result ADMIN_DELETE_CONTRIBUTION( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution + .ADMIN_DELETE_CONTRIBUTION + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_contribution as a table. + */ + public static AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.call( + contribIdInput); + } + + /** + * Get ehr.admin_delete_contribution as a table. + */ + public static AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION(Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.call( + contribIdInput); + } + + /** + * The table ehr.admin_delete_ehr. + */ + public static final AdminDeleteEhr ADMIN_DELETE_EHR = AdminDeleteEhr.ADMIN_DELETE_EHR; + + /** + * Call ehr.admin_delete_ehr. + */ + public static Result ADMIN_DELETE_EHR(Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call( + ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr as a table. + */ + public static AdminDeleteEhr ADMIN_DELETE_EHR(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call(ehrIdInput); + } + + /** + * Get ehr.admin_delete_ehr as a table. + */ + public static AdminDeleteEhr ADMIN_DELETE_EHR(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr.ADMIN_DELETE_EHR.call(ehrIdInput); + } + + /** + * The table ehr.admin_delete_ehr_full. + */ + public static final AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL = AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL; + + /** + * Call ehr.admin_delete_ehr_full. + */ + public static Result ADMIN_DELETE_EHR_FULL(Configuration configuration, UUID ehrIdParam) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr_full as a table. + */ + public static AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL(UUID ehrIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam); + } + + /** + * Get ehr.admin_delete_ehr_full as a table. + */ + public static AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL(Field ehrIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.call( + ehrIdParam); + } + + /** + * The table ehr.admin_delete_ehr_history. + */ + public static final AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY = AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY; + + /** + * Call ehr.admin_delete_ehr_history. + */ + public static Result ADMIN_DELETE_EHR_HISTORY( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_ehr_history as a table. + */ + public static AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.call( + ehrIdInput); + } + + /** + * Get ehr.admin_delete_ehr_history as a table. + */ + public static AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.call( + ehrIdInput); + } + + /** + * The table ehr.admin_delete_event_context_for_compo. + */ + public static final AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO = + AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO; + + /** + * Call ehr.admin_delete_event_context_for_compo. + */ + public static Result ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO( + Configuration configuration, UUID compoIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_event_context_for_compo as a table. + */ + public static AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO(UUID compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput); + } + + /** + * Get ehr.admin_delete_event_context_for_compo as a table. + */ + public static AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO(Field compoIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo + .ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO + .call(compoIdInput); + } + + /** + * The table ehr.admin_delete_status. + */ + public static final AdminDeleteStatus ADMIN_DELETE_STATUS = AdminDeleteStatus.ADMIN_DELETE_STATUS; + + /** + * Call ehr.admin_delete_status. + */ + public static Result ADMIN_DELETE_STATUS(Configuration configuration, UUID statusIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_status as a table. + */ + public static AdminDeleteStatus ADMIN_DELETE_STATUS(UUID statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput); + } + + /** + * Get ehr.admin_delete_status as a table. + */ + public static AdminDeleteStatus ADMIN_DELETE_STATUS(Field statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus.ADMIN_DELETE_STATUS.call( + statusIdInput); + } + + /** + * The table ehr.admin_delete_status_history. + */ + public static final AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY = + AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY; + + /** + * Call ehr.admin_delete_status_history. + */ + public static Result ADMIN_DELETE_STATUS_HISTORY( + Configuration configuration, UUID statusIdInput) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory + .ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_delete_status_history as a table. + */ + public static AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY(UUID statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput); + } + + /** + * Get ehr.admin_delete_status_history as a table. + */ + public static AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY(Field statusIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY + .call(statusIdInput); + } + + /** + * The table ehr.admin_delete_tenant_full. + */ + public static final AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL = AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL; + + /** + * Call ehr.admin_delete_tenant_full. + */ + public static Result ADMIN_DELETE_TENANT_FULL( + Configuration configuration, Short tenantIdParam) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL + .call(tenantIdParam)) + .fetch(); + } + + /** + * Get ehr.admin_delete_tenant_full as a table. + */ + public static AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL(Short tenantIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.call( + tenantIdParam); + } + + /** + * Get ehr.admin_delete_tenant_full as a table. + */ + public static AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL(Field tenantIdParam) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.call( + tenantIdParam); + } + + /** + * The table ehr.admin_get_linked_compositions. + */ + public static final AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS = + AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS; + + /** + * Call ehr.admin_get_linked_compositions. + */ + public static Result ADMIN_GET_LINKED_COMPOSITIONS( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions + .ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_compositions as a table. + */ + public static AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput); + } + + /** + * Get ehr.admin_get_linked_compositions as a table. + */ + public static AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS + .call(ehrIdInput); + } + + /** + * The table ehr.admin_get_linked_compositions_for_contrib. + */ + public static final AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB = + AdminGetLinkedCompositionsForContrib.ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB; + + /** + * Call ehr.admin_get_linked_compositions_for_contrib. + */ + public static Result ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_compositions_for_contrib as a + * table. + */ + public static AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Get ehr.admin_get_linked_compositions_for_contrib as a + * table. + */ + public static AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB( + Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib + .ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * The table ehr.admin_get_linked_contributions. + */ + public static final AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS = + AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS; + + /** + * Call ehr.admin_get_linked_contributions. + */ + public static Result ADMIN_GET_LINKED_CONTRIBUTIONS( + Configuration configuration, UUID ehrIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_contributions as a table. + */ + public static AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS(UUID ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput); + } + + /** + * Get ehr.admin_get_linked_contributions as a table. + */ + public static AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS(Field ehrIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions + .ADMIN_GET_LINKED_CONTRIBUTIONS + .call(ehrIdInput); + } + + /** + * The table ehr.admin_get_linked_status_for_contrib. + */ + public static final AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB = + AdminGetLinkedStatusForContrib.ADMIN_GET_LINKED_STATUS_FOR_CONTRIB; + + /** + * Call ehr.admin_get_linked_status_for_contrib. + */ + public static Result ADMIN_GET_LINKED_STATUS_FOR_CONTRIB( + Configuration configuration, UUID contribIdInput) { + return configuration + .dsl() + .selectFrom(org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput)) + .fetch(); + } + + /** + * Get ehr.admin_get_linked_status_for_contrib as a table. + */ + public static AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB(UUID contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * Get ehr.admin_get_linked_status_for_contrib as a table. + */ + public static AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB(Field contribIdInput) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib + .ADMIN_GET_LINKED_STATUS_FOR_CONTRIB + .call(contribIdInput); + } + + /** + * The table ehr.admin_get_template_usage. + */ + public static final AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE = AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE; + + /** + * Call ehr.admin_get_template_usage. + */ + public static Result ADMIN_GET_TEMPLATE_USAGE( + Configuration configuration, String targetId) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE + .call(targetId)) + .fetch(); + } + + /** + * Get ehr.admin_get_template_usage as a table. + */ + public static AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE(String targetId) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.call( + targetId); + } + + /** + * Get ehr.admin_get_template_usage as a table. + */ + public static AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE(Field targetId) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.call( + targetId); + } + + /** + * The table ehr.attestation. + */ + public static final Attestation ATTESTATION = Attestation.ATTESTATION; + + /** + * The table ehr.attestation_ref. + */ + public static final AttestationRef ATTESTATION_REF = AttestationRef.ATTESTATION_REF; + + /** + * The table ehr.attested_view. + */ + public static final AttestedView ATTESTED_VIEW = AttestedView.ATTESTED_VIEW; + + /** + * The table ehr.audit_details. + */ + public static final AuditDetails AUDIT_DETAILS = AuditDetails.AUDIT_DETAILS; + + /** + * The table ehr.comp_expand. + */ + public static final CompExpand COMP_EXPAND = CompExpand.COMP_EXPAND; + + /** + * The table ehr.compo_xref. + */ + public static final CompoXref COMPO_XREF = CompoXref.COMPO_XREF; + + /** + * Composition table + */ + public static final Composition COMPOSITION = Composition.COMPOSITION; + + /** + * The table ehr.composition_history. + */ + public static final CompositionHistory COMPOSITION_HISTORY = CompositionHistory.COMPOSITION_HISTORY; + + /** + * openEHR common concepts (e.g. terminology) used in the system + */ + public static final Concept CONCEPT = Concept.CONCEPT; + + /** + * Contribution table, compositions reference this table + */ + public static final Contribution CONTRIBUTION = Contribution.CONTRIBUTION; + + /** + * EHR itself + */ + public static final Ehr EHR_ = Ehr.EHR_; + + /** + * The table ehr.ehr_folder. + */ + public static final EhrFolder EHR_FOLDER = EhrFolder.EHR_FOLDER; + + /** + * The table ehr.ehr_folder_history. + */ + public static final EhrFolderHistory EHR_FOLDER_HISTORY = EhrFolderHistory.EHR_FOLDER_HISTORY; + + /** + * The table ehr.ehr_status. + */ + public static final EhrStatus EHR_STATUS = EhrStatus.EHR_STATUS; + + /** + * this table hold the actual archetyped data values (fromBinder a template) + */ + public static final Entry ENTRY = Entry.ENTRY; + + /** + * The table ehr.entry_history. + */ + public static final EntryHistory ENTRY_HISTORY = EntryHistory.ENTRY_HISTORY; + + /** + * defines the context of an event (time, who, where... see openEHR IM 5.2 + */ + public static final EventContext EVENT_CONTEXT = EventContext.EVENT_CONTEXT; + + /** + * The table ehr.event_context_history. + */ + public static final EventContextHistory EVENT_CONTEXT_HISTORY = EventContextHistory.EVENT_CONTEXT_HISTORY; + + /** + * The table ehr.flyway_schema_history. + */ + public static final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY; + + /** + * The table ehr.heading. + */ + public static final Heading HEADING = Heading.HEADING; + + /** + * specifies an identifier for a party identified, more than one identifier + * is possible + */ + public static final Identifier IDENTIFIER = Identifier.IDENTIFIER; + + /** + * The table ehr.jsonb_array_elements. + */ + public static final JsonbArrayElements JSONB_ARRAY_ELEMENTS = JsonbArrayElements.JSONB_ARRAY_ELEMENTS; + + /** + * Call ehr.jsonb_array_elements. + */ + public static Result JSONB_ARRAY_ELEMENTS(Configuration configuration, JSONB jsonbVal) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call( + jsonbVal)) + .fetch(); + } + + /** + * Get ehr.jsonb_array_elements as a table. + */ + public static JsonbArrayElements JSONB_ARRAY_ELEMENTS(JSONB jsonbVal) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call(jsonbVal); + } + + /** + * Get ehr.jsonb_array_elements as a table. + */ + public static JsonbArrayElements JSONB_ARRAY_ELEMENTS(Field jsonbVal) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements.JSONB_ARRAY_ELEMENTS.call(jsonbVal); + } + + /** + * ISO 639-1 language codeset + */ + public static final Language LANGUAGE = Language.LANGUAGE; + + /** + * define a participating party for an event f.ex. + */ + public static final Participation PARTICIPATION = Participation.PARTICIPATION; + + /** + * The table ehr.participation_history. + */ + public static final ParticipationHistory PARTICIPATION_HISTORY = ParticipationHistory.PARTICIPATION_HISTORY; + + /** + * The table ehr.party_identified. + */ + public static final PartyIdentified PARTY_IDENTIFIED = PartyIdentified.PARTY_IDENTIFIED; + + /** + * The table ehr.party_usage_identification. + */ + public static final PartyUsageIdentification PARTY_USAGE_IDENTIFICATION = + PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION; + + /** + * Call ehr.party_usage_identification. + */ + public static Result PARTY_USAGE_IDENTIFICATION( + Configuration configuration, UUID partyUuid) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification + .PARTY_USAGE_IDENTIFICATION + .call(partyUuid)) + .fetch(); + } + + /** + * Get ehr.party_usage_identification as a table. + */ + public static PartyUsageIdentification PARTY_USAGE_IDENTIFICATION(UUID partyUuid) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION + .call(partyUuid); + } + + /** + * Get ehr.party_usage_identification as a table. + */ + public static PartyUsageIdentification PARTY_USAGE_IDENTIFICATION(Field partyUuid) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION + .call(partyUuid); + } + + /** + * key value store for plugin sub system + */ + public static final Plugin PLUGIN = Plugin.PLUGIN; + + /** + * The table ehr.session_log. + */ + public static final SessionLog SESSION_LOG = SessionLog.SESSION_LOG; + + /** + * specifies an ehr modality and ownership (patient) + */ + public static final Status STATUS = Status.STATUS; + + /** + * The table ehr.status_history. + */ + public static final StatusHistory STATUS_HISTORY = StatusHistory.STATUS_HISTORY; + + /** + * The table ehr.stored_query. + */ + public static final StoredQuery STORED_QUERY = StoredQuery.STORED_QUERY; + + /** + * system table for reference + */ + public static final System SYSTEM = System.SYSTEM; + + /** + * The table ehr.template_store. + */ + public static final TemplateStore TEMPLATE_STORE = TemplateStore.TEMPLATE_STORE; + + /** + * The table ehr.tenant. + */ + public static final Tenant TENANT = Tenant.TENANT; + + /** + * openEHR identified terminology provider + */ + public static final TerminologyProvider TERMINOLOGY_PROVIDER = TerminologyProvider.TERMINOLOGY_PROVIDER; + + /** + * ISO 3166-1 countries codeset + */ + public static final Territory TERRITORY = Territory.TERRITORY; + + /** + * The table ehr.users. + */ + public static final Users USERS = Users.USERS; + + /** + * The table ehr.xjsonb_array_elements. + */ + public static final XjsonbArrayElements XJSONB_ARRAY_ELEMENTS = XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS; + + /** + * Call ehr.xjsonb_array_elements. + */ + public static Result XJSONB_ARRAY_ELEMENTS(Configuration configuration, JSONB entry) { + return configuration + .dsl() + .selectFrom( + org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call( + entry)) + .fetch(); + } + + /** + * Get ehr.xjsonb_array_elements as a table. + */ + public static XjsonbArrayElements XJSONB_ARRAY_ELEMENTS(JSONB entry) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call(entry); + } + + /** + * Get ehr.xjsonb_array_elements as a table. + */ + public static XjsonbArrayElements XJSONB_ARRAY_ELEMENTS(Field entry) { + return org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.call(entry); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/UDTs.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/UDTs.java new file mode 100644 index 0000000..de0ced5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/UDTs.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg; + +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText; + +/** + * Convenience access to all UDTs in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class UDTs { + + /** + * The type ehr.code_phrase + */ + public static final CodePhrase CODE_PHRASE = org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE; + + /** + * The type ehr.dv_coded_text + */ + public static final DvCodedText DV_CODED_TEXT = + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT; +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionChangeType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionChangeType.java new file mode 100644 index 0000000..8abc15d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionChangeType.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.enums; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum ContributionChangeType implements EnumType { + creation("creation"), + + amendment("amendment"), + + modification("modification"), + + synthesis("synthesis"), + + Unknown("Unknown"), + + deleted("deleted"); + + private final String literal; + + private ContributionChangeType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "contribution_change_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static ContributionChangeType lookupLiteral(String literal) { + return EnumType.lookupLiteral(ContributionChangeType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionDataType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionDataType.java new file mode 100644 index 0000000..18ee679 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionDataType.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.enums; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum ContributionDataType implements EnumType { + composition("composition"), + + folder("folder"), + + ehr("ehr"), + + system("system"), + + other("other"); + + private final String literal; + + private ContributionDataType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "contribution_data_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static ContributionDataType lookupLiteral(String literal) { + return EnumType.lookupLiteral(ContributionDataType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionState.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionState.java new file mode 100644 index 0000000..af13152 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/ContributionState.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.enums; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum ContributionState implements EnumType { + complete("complete"), + + incomplete("incomplete"), + + deleted("deleted"); + + private final String literal; + + private ContributionState(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "contribution_state"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static ContributionState lookupLiteral(String literal) { + return EnumType.lookupLiteral(ContributionState.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/EntryType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/EntryType.java new file mode 100644 index 0000000..9c58bc7 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/EntryType.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.enums; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum EntryType implements EnumType { + section("section"), + + care_entry("care_entry"), + + admin("admin"), + + proxy("proxy"); + + private final String literal; + + private EntryType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "entry_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static EntryType lookupLiteral(String literal) { + return EnumType.lookupLiteral(EntryType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyRefIdType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyRefIdType.java new file mode 100644 index 0000000..8a39f91 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyRefIdType.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.enums; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum PartyRefIdType implements EnumType { + generic_id("generic_id"), + + object_version_id("object_version_id"), + + hier_object_id("hier_object_id"), + + undefined("undefined"); + + private final String literal; + + private PartyRefIdType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "party_ref_id_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static PartyRefIdType lookupLiteral(String literal) { + return EnumType.lookupLiteral(PartyRefIdType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyType.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyType.java new file mode 100644 index 0000000..7057bb5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/enums/PartyType.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.enums; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum PartyType implements EnumType { + party_identified("party_identified"), + + party_self("party_self"), + + party_related("party_related"); + + private final String literal; + + private PartyType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "party_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static PartyType lookupLiteral(String literal) { + return EnumType.lookupLiteral(PartyType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteAllTemplates.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteAllTemplates.java new file mode 100644 index 0000000..ee9e217 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteAllTemplates.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteAllTemplates extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.admin_delete_all_templates.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.INTEGER, false, false); + + /** + * Create a new routine call instance + */ + public AdminDeleteAllTemplates() { + super("admin_delete_all_templates", Ehr.EHR, SQLDataType.INTEGER); + + setReturnParameter(RETURN_VALUE); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteTemplate.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteTemplate.java new file mode 100644 index 0000000..afaef2e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminDeleteTemplate.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteTemplate extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.admin_delete_template.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.INTEGER, false, false); + + /** + * The parameter ehr.admin_delete_template.target_id. + */ + public static final Parameter TARGET_ID = + Internal.createParameter("target_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public AdminDeleteTemplate() { + super("admin_delete_template", Ehr.EHR, SQLDataType.INTEGER); + + setReturnParameter(RETURN_VALUE); + addInParameter(TARGET_ID); + } + + /** + * Set the target_id parameter IN value to the routine + */ + public void setTargetId(String value) { + setValue(TARGET_ID, value); + } + + /** + * Set the target_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setTargetId(Field field) { + setField(TARGET_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminUpdateTemplate.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminUpdateTemplate.java new file mode 100644 index 0000000..9c6b960 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AdminUpdateTemplate.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminUpdateTemplate extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.admin_update_template.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.admin_update_template.target_id. + */ + public static final Parameter TARGET_ID = + Internal.createParameter("target_id", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.admin_update_template.update_content. + */ + public static final Parameter UPDATE_CONTENT = + Internal.createParameter("update_content", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public AdminUpdateTemplate() { + super("admin_update_template", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(TARGET_ID); + addInParameter(UPDATE_CONTENT); + } + + /** + * Set the target_id parameter IN value to the routine + */ + public void setTargetId(String value) { + setValue(TARGET_ID, value); + } + + /** + * Set the target_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setTargetId(Field field) { + setField(TARGET_ID, field); + } + + /** + * Set the update_content parameter IN value to the routine + */ + public void setUpdateContent(String value) { + setValue(UPDATE_CONTENT, value); + } + + /** + * Set the update_content parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setUpdateContent(Field field) { + setField(UPDATE_CONTENT, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AqlNodeNamePredicate.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AqlNodeNamePredicate.java new file mode 100644 index 0000000..1698350 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/AqlNodeNamePredicate.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AqlNodeNamePredicate extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.aql_node_name_predicate.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.aql_node_name_predicate.entry. + */ + public static final Parameter ENTRY = Internal.createParameter("entry", SQLDataType.JSONB, false, false); + + /** + * The parameter + * ehr.aql_node_name_predicate.name_value_predicate. + */ + public static final Parameter NAME_VALUE_PREDICATE = + Internal.createParameter("name_value_predicate", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.aql_node_name_predicate.jsonb_path. + */ + public static final Parameter JSONB_PATH = + Internal.createParameter("jsonb_path", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public AqlNodeNamePredicate() { + super("aql_node_name_predicate", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(ENTRY); + addInParameter(NAME_VALUE_PREDICATE); + addInParameter(JSONB_PATH); + } + + /** + * Set the entry parameter IN value to the routine + */ + public void setEntry(JSONB value) { + setValue(ENTRY, value); + } + + /** + * Set the entry parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setEntry(Field field) { + setField(ENTRY, field); + } + + /** + * Set the name_value_predicate parameter IN value to the + * routine + */ + public void setNameValuePredicate(String value) { + setValue(NAME_VALUE_PREDICATE, value); + } + + /** + * Set the name_value_predicate parameter to the function to be + * used with a {@link org.jooq.Select} statement + */ + public void setNameValuePredicate(Field field) { + setField(NAME_VALUE_PREDICATE, field); + } + + /** + * Set the jsonb_path parameter IN value to the routine + */ + public void setJsonbPath(String value) { + setValue(JSONB_PATH, value); + } + + /** + * Set the jsonb_path parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setJsonbPath(Field field) { + setField(JSONB_PATH, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CamelToSnake.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CamelToSnake.java new file mode 100644 index 0000000..f1151a1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CamelToSnake.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CamelToSnake extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.camel_to_snake.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.camel_to_snake.literal. + */ + public static final Parameter LITERAL = Internal.createParameter("literal", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public CamelToSnake() { + super("camel_to_snake", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(LITERAL); + } + + /** + * Set the literal parameter IN value to the routine + */ + public void setLiteral(String value) { + setValue(LITERAL, value); + } + + /** + * Set the literal parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setLiteral(Field field) { + setField(LITERAL, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionName.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionName.java new file mode 100644 index 0000000..976f8c5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionName.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompositionName extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.composition_name.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.composition_name.content. + */ + public static final Parameter CONTENT = Internal.createParameter("content", SQLDataType.JSONB, false, false); + + /** + * Create a new routine call instance + */ + public CompositionName() { + super("composition_name", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(CONTENT); + } + + /** + * Set the content parameter IN value to the routine + */ + public void setContent(JSONB value) { + setValue(CONTENT, value); + } + + /** + * Set the content parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setContent(Field field) { + setField(CONTENT, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionUid.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionUid.java new file mode 100644 index 0000000..16954a0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/CompositionUid.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompositionUid extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.composition_uid.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.composition_uid.composition_uid. + */ + public static final Parameter COMPOSITION_UID = + Internal.createParameter("composition_uid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.composition_uid.server_id. + */ + public static final Parameter SERVER_ID = + Internal.createParameter("server_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public CompositionUid() { + super("composition_uid", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(COMPOSITION_UID); + addInParameter(SERVER_ID); + } + + /** + * Set the composition_uid parameter IN value to the routine + */ + public void setCompositionUid(UUID value) { + setValue(COMPOSITION_UID, value); + } + + /** + * Set the composition_uid parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setCompositionUid(Field field) { + setField(COMPOSITION_UID, field); + } + + /** + * Set the server_id parameter IN value to the routine + */ + public void setServerId(String value) { + setValue(SERVER_ID, value); + } + + /** + * Set the server_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setServerId(Field field) { + setField(SERVER_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/DeleteOrphanHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/DeleteOrphanHistory.java new file mode 100644 index 0000000..00d8433 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/DeleteOrphanHistory.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class DeleteOrphanHistory extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.delete_orphan_history.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.BOOLEAN, false, false); + + /** + * Create a new routine call instance + */ + public DeleteOrphanHistory() { + super("delete_orphan_history", Ehr.EHR, SQLDataType.BOOLEAN); + + setReturnParameter(RETURN_VALUE); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/EhrStatusUid.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/EhrStatusUid.java new file mode 100644 index 0000000..bf8b41b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/EhrStatusUid.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrStatusUid extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.ehr_status_uid.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.ehr_status_uid.ehr_uuid. + */ + public static final Parameter EHR_UUID = Internal.createParameter("ehr_uuid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.ehr_status_uid.server_id. + */ + public static final Parameter SERVER_ID = + Internal.createParameter("server_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public EhrStatusUid() { + super("ehr_status_uid", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(EHR_UUID); + addInParameter(SERVER_ID); + } + + /** + * Set the ehr_uuid parameter IN value to the routine + */ + public void setEhrUuid(UUID value) { + setValue(EHR_UUID, value); + } + + /** + * Set the ehr_uuid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setEhrUuid(Field field) { + setField(EHR_UUID, field); + } + + /** + * Set the server_id parameter IN value to the routine + */ + public void setServerId(String value) { + setValue(SERVER_ID, value); + } + + /** + * Set the server_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setServerId(Field field) { + setField(SERVER_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/FolderUid.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/FolderUid.java new file mode 100644 index 0000000..60be690 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/FolderUid.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class FolderUid extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.folder_uid.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.folder_uid.folder_uid. + */ + public static final Parameter FOLDER_UID = + Internal.createParameter("folder_uid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.folder_uid.server_id. + */ + public static final Parameter SERVER_ID = + Internal.createParameter("server_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public FolderUid() { + super("folder_uid", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(FOLDER_UID); + addInParameter(SERVER_ID); + } + + /** + * Set the folder_uid parameter IN value to the routine + */ + public void setFolderUid(UUID value) { + setValue(FOLDER_UID, value); + } + + /** + * Set the folder_uid parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setFolderUid(Field field) { + setField(FOLDER_UID, field); + } + + /** + * Set the server_id parameter IN value to the routine + */ + public void setServerId(String value) { + setValue(SERVER_ID, value); + } + + /** + * Set the server_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setServerId(Field field) { + setField(SERVER_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/GetSystemVersion.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/GetSystemVersion.java new file mode 100644 index 0000000..483d4a0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/GetSystemVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class GetSystemVersion extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.get_system_version.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public GetSystemVersion() { + super("get_system_version", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/IsoTimestamp.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/IsoTimestamp.java new file mode 100644 index 0000000..8914191 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/IsoTimestamp.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.time.OffsetDateTime; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class IsoTimestamp extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.iso_timestamp.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.VARCHAR, false, false); + + /** + * The parameter ehr.iso_timestamp._1. + */ + public static final Parameter _1 = + Internal.createParameter("_1", SQLDataType.TIMESTAMPWITHTIMEZONE(6), false, true); + + /** + * Create a new routine call instance + */ + public IsoTimestamp() { + super("iso_timestamp", Ehr.EHR, SQLDataType.VARCHAR); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(OffsetDateTime value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails1.java new file mode 100644 index 0000000..7f7703a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails1.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsArchetypeDetails1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_archetype_details.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.js_archetype_details.archetype_node_id. + */ + public static final Parameter ARCHETYPE_NODE_ID = + Internal.createParameter("archetype_node_id", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_archetype_details.template_id. + */ + public static final Parameter TEMPLATE_ID = + Internal.createParameter("template_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsArchetypeDetails1() { + super("js_archetype_details", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(ARCHETYPE_NODE_ID); + addInParameter(TEMPLATE_ID); + setOverloaded(true); + } + + /** + * Set the archetype_node_id parameter IN value to the routine + */ + public void setArchetypeNodeId(String value) { + setValue(ARCHETYPE_NODE_ID, value); + } + + /** + * Set the archetype_node_id parameter to the function to be + * used with a {@link org.jooq.Select} statement + */ + public void setArchetypeNodeId(Field field) { + setField(ARCHETYPE_NODE_ID, field); + } + + /** + * Set the template_id parameter IN value to the routine + */ + public void setTemplateId(String value) { + setValue(TEMPLATE_ID, value); + } + + /** + * Set the template_id parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setTemplateId(Field field) { + setField(TEMPLATE_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails2.java new file mode 100644 index 0000000..8c04360 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetypeDetails2.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsArchetypeDetails2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_archetype_details.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.js_archetype_details.archetype_node_id. + */ + public static final Parameter ARCHETYPE_NODE_ID = + Internal.createParameter("archetype_node_id", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_archetype_details.template_id. + */ + public static final Parameter TEMPLATE_ID = + Internal.createParameter("template_id", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_archetype_details.rm_version. + */ + public static final Parameter RM_VERSION = + Internal.createParameter("rm_version", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsArchetypeDetails2() { + super("js_archetype_details", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(ARCHETYPE_NODE_ID); + addInParameter(TEMPLATE_ID); + addInParameter(RM_VERSION); + setOverloaded(true); + } + + /** + * Set the archetype_node_id parameter IN value to the routine + */ + public void setArchetypeNodeId(String value) { + setValue(ARCHETYPE_NODE_ID, value); + } + + /** + * Set the archetype_node_id parameter to the function to be + * used with a {@link org.jooq.Select} statement + */ + public void setArchetypeNodeId(Field field) { + setField(ARCHETYPE_NODE_ID, field); + } + + /** + * Set the template_id parameter IN value to the routine + */ + public void setTemplateId(String value) { + setValue(TEMPLATE_ID, value); + } + + /** + * Set the template_id parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setTemplateId(Field field) { + setField(TEMPLATE_ID, field); + } + + /** + * Set the rm_version parameter IN value to the routine + */ + public void setRmVersion(String value) { + setValue(RM_VERSION, value); + } + + /** + * Set the rm_version parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setRmVersion(Field field) { + setField(RM_VERSION, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetyped.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetyped.java new file mode 100644 index 0000000..ad796f8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsArchetyped.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsArchetyped extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_archetyped.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_archetyped._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_archetyped._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsArchetyped() { + super("js_archetyped", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsAuditDetails.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsAuditDetails.java new file mode 100644 index 0000000..25df32b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsAuditDetails.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsAuditDetails extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_audit_details.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_audit_details._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsAuditDetails() { + super("js_audit_details", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalDvQuantity.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalDvQuantity.java new file mode 100644 index 0000000..8c9bc6c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalDvQuantity.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalDvQuantity extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_dv_quantity.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_dv_quantity.magnitude. + */ + public static final Parameter MAGNITUDE = + Internal.createParameter("magnitude", SQLDataType.DOUBLE, false, false); + + /** + * The parameter ehr.js_canonical_dv_quantity.units. + */ + public static final Parameter UNITS = Internal.createParameter("units", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_canonical_dv_quantity._precision. + */ + public static final Parameter _PRECISION = + Internal.createParameter("_precision", SQLDataType.INTEGER, false, false); + + /** + * The parameter ehr.js_canonical_dv_quantity.accuracy_percent. + */ + public static final Parameter ACCURACY_PERCENT = + Internal.createParameter("accuracy_percent", SQLDataType.BOOLEAN, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalDvQuantity() { + super("js_canonical_dv_quantity", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(MAGNITUDE); + addInParameter(UNITS); + addInParameter(_PRECISION); + addInParameter(ACCURACY_PERCENT); + } + + /** + * Set the magnitude parameter IN value to the routine + */ + public void setMagnitude(Double value) { + setValue(MAGNITUDE, value); + } + + /** + * Set the magnitude parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setMagnitude(Field field) { + setField(MAGNITUDE, field); + } + + /** + * Set the units parameter IN value to the routine + */ + public void setUnits(String value) { + setValue(UNITS, value); + } + + /** + * Set the units parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setUnits(Field field) { + setField(UNITS, field); + } + + /** + * Set the _precision parameter IN value to the routine + */ + public void set_Precision(Integer value) { + setValue(_PRECISION, value); + } + + /** + * Set the _precision parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void set_Precision(Field field) { + setField(_PRECISION, field); + } + + /** + * Set the accuracy_percent parameter IN value to the routine + */ + public void setAccuracyPercent(Boolean value) { + setValue(ACCURACY_PERCENT, value); + } + + /** + * Set the accuracy_percent parameter to the function to be + * used with a {@link org.jooq.Select} statement + */ + public void setAccuracyPercent(Field field) { + setField(ACCURACY_PERCENT, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalGenericId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalGenericId.java new file mode 100644 index 0000000..65579cc --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalGenericId.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalGenericId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_generic_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_generic_id.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_canonical_generic_id.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalGenericId() { + super("js_canonical_generic_id", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId1.java new file mode 100644 index 0000000..c6e0732 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId1.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalHierObjectId1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_hier_object_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_hier_object_id.ehr_id. + */ + public static final Parameter EHR_ID = Internal.createParameter("ehr_id", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalHierObjectId1() { + super("js_canonical_hier_object_id", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(EHR_ID); + setOverloaded(true); + } + + /** + * Set the ehr_id parameter IN value to the routine + */ + public void setEhrId(UUID value) { + setValue(EHR_ID, value); + } + + /** + * Set the ehr_id parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setEhrId(Field field) { + setField(EHR_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId2.java new file mode 100644 index 0000000..5937475 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalHierObjectId2.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalHierObjectId2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_hier_object_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_hier_object_id.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalHierObjectId2() { + super("js_canonical_hier_object_id", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(ID_VALUE); + setOverloaded(true); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectId.java new file mode 100644 index 0000000..b0895c8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectId.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalObjectId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_object_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_object_id.objectid_type. + */ + public static final Parameter OBJECTID_TYPE = Internal.createParameter( + "objectid_type", + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType.class), + false, + false); + + /** + * The parameter ehr.js_canonical_object_id.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_canonical_object_id.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalObjectId() { + super("js_canonical_object_id", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(OBJECTID_TYPE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + } + + /** + * Set the objectid_type parameter IN value to the routine + */ + public void setObjectidType(PartyRefIdType value) { + setValue(OBJECTID_TYPE, value); + } + + /** + * Set the objectid_type parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setObjectidType(Field field) { + setField(OBJECTID_TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectVersionId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectVersionId.java new file mode 100644 index 0000000..d233da1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalObjectVersionId.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalObjectVersionId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter + * ehr.js_canonical_object_version_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_object_version_id.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalObjectVersionId() { + super("js_canonical_object_version_id", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(ID_VALUE); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalParticipations.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalParticipations.java new file mode 100644 index 0000000..1ab5d25 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalParticipations.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalParticipations extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_participations.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_participations.context_id. + */ + public static final Parameter CONTEXT_ID = + Internal.createParameter("context_id", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalParticipations() { + super("js_canonical_participations", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(CONTEXT_ID); + } + + /** + * Set the context_id parameter IN value to the routine + */ + public void setContextId(UUID value) { + setValue(CONTEXT_ID, value); + } + + /** + * Set the context_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setContextId(Field field) { + setField(CONTEXT_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyIdentified.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyIdentified.java new file mode 100644 index 0000000..14389de --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyIdentified.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalPartyIdentified extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter + * ehr.js_canonical_party_identified.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_party_identified.refid. + */ + public static final Parameter REFID = Internal.createParameter("refid", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalPartyIdentified() { + super("js_canonical_party_identified", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(REFID); + } + + /** + * Set the refid parameter IN value to the routine + */ + public void setRefid(UUID value) { + setValue(REFID, value); + } + + /** + * Set the refid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefid(Field field) { + setField(REFID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyRef.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyRef.java new file mode 100644 index 0000000..e75e769 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCanonicalPartyRef.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCanonicalPartyRef extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_canonical_party_ref.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_canonical_party_ref.namespace. + */ + public static final Parameter NAMESPACE = + Internal.createParameter("namespace", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_canonical_party_ref.type. + */ + public static final Parameter TYPE = Internal.createParameter("type", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_canonical_party_ref.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_canonical_party_ref.id. + */ + public static final Parameter ID = Internal.createParameter("id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsCanonicalPartyRef() { + super("js_canonical_party_ref", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(NAMESPACE); + addInParameter(TYPE); + addInParameter(SCHEME); + addInParameter(ID); + } + + /** + * Set the namespace parameter IN value to the routine + */ + public void setNamespace(String value) { + setValue(NAMESPACE, value); + } + + /** + * Set the namespace parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setNamespace(Field field) { + setField(NAMESPACE, field); + } + + /** + * Set the type parameter IN value to the routine + */ + public void setType(String value) { + setValue(TYPE, value); + } + + /** + * Set the type parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setType(Field field) { + setField(TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id parameter IN value to the routine + */ + public void setId(String value) { + setValue(ID, value); + } + + /** + * Set the id parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setId(Field field) { + setField(ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase1.java new file mode 100644 index 0000000..9a283a9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase1.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCodePhrase1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_code_phrase.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_code_phrase._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_code_phrase._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsCodePhrase1() { + super("js_code_phrase", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase2.java new file mode 100644 index 0000000..d356249 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsCodePhrase2.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.CodePhraseRecord; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsCodePhrase2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_code_phrase.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_code_phrase.codephrase. + */ + public static final Parameter CODEPHRASE = Internal.createParameter( + "codephrase", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(), + false, + false); + + /** + * Create a new routine call instance + */ + public JsCodePhrase2() { + super("js_code_phrase", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(CODEPHRASE); + setOverloaded(true); + } + + /** + * Set the codephrase parameter IN value to the routine + */ + public void setCodephrase(CodePhraseRecord value) { + setValue(CODEPHRASE, value); + } + + /** + * Set the codephrase parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setCodephrase(Field field) { + setField(CODEPHRASE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition1.java new file mode 100644 index 0000000..29541cd --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition1.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsComposition1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_composition.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_composition._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsComposition1() { + super("js_composition", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition2.java new file mode 100644 index 0000000..19e8327 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsComposition2.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsComposition2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_composition.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_composition._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * The parameter ehr.js_composition.server_node_id. + */ + public static final Parameter SERVER_NODE_ID = + Internal.createParameter("server_node_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsComposition2() { + super("js_composition", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(SERVER_NODE_ID); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the server_node_id parameter IN value to the routine + */ + public void setServerNodeId(String value) { + setValue(SERVER_NODE_ID, value); + } + + /** + * Set the server_node_id parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setServerNodeId(Field field) { + setField(SERVER_NODE_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsConcept.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsConcept.java new file mode 100644 index 0000000..54ed56f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsConcept.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsConcept extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_concept.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_concept._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsConcept() { + super("js_concept", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContext.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContext.java new file mode 100644 index 0000000..92c898f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContext.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsContext extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_context.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_context._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsContext() { + super("js_context", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContextSetting.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContextSetting.java new file mode 100644 index 0000000..404dd2c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContextSetting.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsContextSetting extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_context_setting.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_context_setting._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsContextSetting() { + super("js_context_setting", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContribution.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContribution.java new file mode 100644 index 0000000..29638ef --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsContribution.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsContribution extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_contribution.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_contribution._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * The parameter ehr.js_contribution._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsContribution() { + super("js_contribution", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText1.java new file mode 100644 index 0000000..38f90e6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText1.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsDvCodedText1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_dv_coded_text.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_dv_coded_text._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_dv_coded_text._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.JSON, false, true); + + /** + * Create a new routine call instance + */ + public JsDvCodedText1() { + super("js_dv_coded_text", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(JSON value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText2.java new file mode 100644 index 0000000..961f513 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedText2.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsDvCodedText2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_dv_coded_text.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_dv_coded_text.dvcodedtext. + */ + public static final Parameter DVCODEDTEXT = Internal.createParameter( + "dvcodedtext", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + false, + false); + + /** + * Create a new routine call instance + */ + public JsDvCodedText2() { + super("js_dv_coded_text", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(DVCODEDTEXT); + setOverloaded(true); + } + + /** + * Set the dvcodedtext parameter IN value to the routine + */ + public void setDvcodedtext(DvCodedTextRecord value) { + setValue(DVCODEDTEXT, value); + } + + /** + * Set the dvcodedtext parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setDvcodedtext(Field field) { + setField(DVCODEDTEXT, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner1.java new file mode 100644 index 0000000..c182515 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner1.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsDvCodedTextInner1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_dv_coded_text_inner.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_dv_coded_text_inner.dvcodedtext. + */ + public static final Parameter DVCODEDTEXT = Internal.createParameter( + "dvcodedtext", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + false, + false); + + /** + * Create a new routine call instance + */ + public JsDvCodedTextInner1() { + super("js_dv_coded_text_inner", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(DVCODEDTEXT); + setOverloaded(true); + } + + /** + * Set the dvcodedtext parameter IN value to the routine + */ + public void setDvcodedtext(DvCodedTextRecord value) { + setValue(DVCODEDTEXT, value); + } + + /** + * Set the dvcodedtext parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setDvcodedtext(Field field) { + setField(DVCODEDTEXT, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner2.java new file mode 100644 index 0000000..a351166 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvCodedTextInner2.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsDvCodedTextInner2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_dv_coded_text_inner.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_dv_coded_text_inner.value. + */ + public static final Parameter VALUE = Internal.createParameter("value", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_dv_coded_text_inner.terminology_id. + */ + public static final Parameter TERMINOLOGY_ID = + Internal.createParameter("terminology_id", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.js_dv_coded_text_inner.code_string. + */ + public static final Parameter CODE_STRING = + Internal.createParameter("code_string", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsDvCodedTextInner2() { + super("js_dv_coded_text_inner", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(VALUE); + addInParameter(TERMINOLOGY_ID); + addInParameter(CODE_STRING); + setOverloaded(true); + } + + /** + * Set the value parameter IN value to the routine + */ + public void setValue(String value) { + setValue(VALUE, value); + } + + /** + * Set the value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setValue(Field field) { + setField(VALUE, field); + } + + /** + * Set the terminology_id parameter IN value to the routine + */ + public void setTerminologyId(String value) { + setValue(TERMINOLOGY_ID, value); + } + + /** + * Set the terminology_id parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setTerminologyId(Field field) { + setField(TERMINOLOGY_ID, field); + } + + /** + * Set the code_string parameter IN value to the routine + */ + public void setCodeString(String value) { + setValue(CODE_STRING, value); + } + + /** + * Set the code_string parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setCodeString(Field field) { + setField(CODE_STRING, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvDateTime.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvDateTime.java new file mode 100644 index 0000000..616fdb0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvDateTime.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.sql.Timestamp; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsDvDateTime extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_dv_date_time.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_dv_date_time._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.TIMESTAMP(6), false, true); + + /** + * The parameter ehr.js_dv_date_time._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsDvDateTime() { + super("js_dv_date_time", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(Timestamp value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvText.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvText.java new file mode 100644 index 0000000..5ce3d9b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsDvText.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsDvText extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_dv_text.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_dv_text._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsDvText() { + super("js_dv_text", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhr.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhr.java new file mode 100644 index 0000000..1ba63d9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhr.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsEhr extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_ehr.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_ehr._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * The parameter ehr.js_ehr._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsEhr() { + super("js_ehr", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus1.java new file mode 100644 index 0000000..1a5926f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus1.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsEhrStatus1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_ehr_status.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_ehr_status._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsEhrStatus1() { + super("js_ehr_status", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus2.java new file mode 100644 index 0000000..eaa7c1f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatus2.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsEhrStatus2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_ehr_status.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_ehr_status.ehr_uuid. + */ + public static final Parameter EHR_UUID = Internal.createParameter("ehr_uuid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.js_ehr_status.server_id. + */ + public static final Parameter SERVER_ID = + Internal.createParameter("server_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsEhrStatus2() { + super("js_ehr_status", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(EHR_UUID); + addInParameter(SERVER_ID); + setOverloaded(true); + } + + /** + * Set the ehr_uuid parameter IN value to the routine + */ + public void setEhrUuid(UUID value) { + setValue(EHR_UUID, value); + } + + /** + * Set the ehr_uuid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setEhrUuid(Field field) { + setField(EHR_UUID, field); + } + + /** + * Set the server_id parameter IN value to the routine + */ + public void setServerId(String value) { + setValue(SERVER_ID, value); + } + + /** + * Set the server_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setServerId(Field field) { + setField(SERVER_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatusUid.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatusUid.java new file mode 100644 index 0000000..69a8d95 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsEhrStatusUid.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsEhrStatusUid extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_ehr_status_uid.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.js_ehr_status_uid.ehr_uuid. + */ + public static final Parameter EHR_UUID = Internal.createParameter("ehr_uuid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.js_ehr_status_uid.server_id. + */ + public static final Parameter SERVER_ID = + Internal.createParameter("server_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsEhrStatusUid() { + super("js_ehr_status_uid", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(EHR_UUID); + addInParameter(SERVER_ID); + } + + /** + * Set the ehr_uuid parameter IN value to the routine + */ + public void setEhrUuid(UUID value) { + setValue(EHR_UUID, value); + } + + /** + * Set the ehr_uuid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setEhrUuid(Field field) { + setField(EHR_UUID, field); + } + + /** + * Set the server_id parameter IN value to the routine + */ + public void setServerId(String value) { + setValue(SERVER_ID, value); + } + + /** + * Set the server_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setServerId(Field field) { + setField(SERVER_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsFolder.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsFolder.java new file mode 100644 index 0000000..8668de5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsFolder.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsFolder extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_folder.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.js_folder.folder_uid. + */ + public static final Parameter FOLDER_UID = + Internal.createParameter("folder_uid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.js_folder.server_id. + */ + public static final Parameter SERVER_ID = + Internal.createParameter("server_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsFolder() { + super("js_folder", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(FOLDER_UID); + addInParameter(SERVER_ID); + } + + /** + * Set the folder_uid parameter IN value to the routine + */ + public void setFolderUid(UUID value) { + setValue(FOLDER_UID, value); + } + + /** + * Set the folder_uid parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setFolderUid(Field field) { + setField(FOLDER_UID, field); + } + + /** + * Set the server_id parameter IN value to the routine + */ + public void setServerId(String value) { + setValue(SERVER_ID, value); + } + + /** + * Set the server_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setServerId(Field field) { + setField(SERVER_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsObjectVersionId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsObjectVersionId.java new file mode 100644 index 0000000..289e57e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsObjectVersionId.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsObjectVersionId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_object_version_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.js_object_version_id.version_id. + */ + public static final Parameter VERSION_ID = + Internal.createParameter("version_id", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsObjectVersionId() { + super("js_object_version_id", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(VERSION_ID); + } + + /** + * Set the version_id parameter IN value to the routine + */ + public void setVersionId(String value) { + setValue(VERSION_ID, value); + } + + /** + * Set the version_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setVersionId(Field field) { + setField(VERSION_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParticipations.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParticipations.java new file mode 100644 index 0000000..115025a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParticipations.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsParticipations extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_participations.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB.array(), false, false); + + /** + * The parameter ehr.js_participations.event_context_id. + */ + public static final Parameter EVENT_CONTEXT_ID = + Internal.createParameter("event_context_id", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public JsParticipations() { + super("js_participations", Ehr.EHR, SQLDataType.JSONB.array()); + + setReturnParameter(RETURN_VALUE); + addInParameter(EVENT_CONTEXT_ID); + } + + /** + * Set the event_context_id parameter IN value to the routine + */ + public void setEventContextId(UUID value) { + setValue(EVENT_CONTEXT_ID, value); + } + + /** + * Set the event_context_id parameter to the function to be + * used with a {@link org.jooq.Select} statement + */ + public void setEventContextId(Field field) { + setField(EVENT_CONTEXT_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParty.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParty.java new file mode 100644 index 0000000..bd43bab --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsParty.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsParty extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_party.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_party._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsParty() { + super("js_party", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyIdentified.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyIdentified.java new file mode 100644 index 0000000..e2e3ba1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyIdentified.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsPartyIdentified extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_party_identified.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_party_identified._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_party_identified._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.JSON, false, true); + + /** + * Create a new routine call instance + */ + public JsPartyIdentified() { + super("js_party_identified", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(JSON value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyRef.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyRef.java new file mode 100644 index 0000000..a1e0771 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartyRef.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsPartyRef extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_party_ref.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_party_ref._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_party_ref._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_party_ref._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_party_ref._4. + */ + public static final Parameter _4 = Internal.createParameter("_4", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public JsPartyRef() { + super("js_party_ref", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + addInParameter(_4); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__3(Field field) { + setField(_3, field); + } + + /** + * Set the _4 parameter IN value to the routine + */ + public void set__4(String value) { + setValue(_4, value); + } + + /** + * Set the _4 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__4(Field field) { + setField(_4, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelf.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelf.java new file mode 100644 index 0000000..f45134f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelf.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsPartySelf extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_party_self.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_party_self._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * Create a new routine call instance + */ + public JsPartySelf() { + super("js_party_self", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelfIdentified.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelfIdentified.java new file mode 100644 index 0000000..4b59354 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsPartySelfIdentified.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsPartySelfIdentified extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_party_self_identified.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.js_party_self_identified._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.js_party_self_identified._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.JSON, false, true); + + /** + * Create a new routine call instance + */ + public JsPartySelfIdentified() { + super("js_party_self_identified", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(JSON value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTermMappings.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTermMappings.java new file mode 100644 index 0000000..d07cb12 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTermMappings.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsTermMappings extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_term_mappings.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB.array(), false, false); + + /** + * The parameter ehr.js_term_mappings.mappings. + */ + public static final Parameter MAPPINGS = + Internal.createParameter("mappings", SQLDataType.CLOB.array(), false, false); + + /** + * Create a new routine call instance + */ + public JsTermMappings() { + super("js_term_mappings", Ehr.EHR, SQLDataType.JSONB.array()); + + setReturnParameter(RETURN_VALUE); + addInParameter(MAPPINGS); + } + + /** + * Set the mappings parameter IN value to the routine + */ + public void setMappings(String[] value) { + setValue(MAPPINGS, value); + } + + /** + * Set the mappings parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setMappings(Field field) { + setField(MAPPINGS, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTypedElementValue.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTypedElementValue.java new file mode 100644 index 0000000..05e6796 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsTypedElementValue.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsTypedElementValue extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.js_typed_element_value.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.js_typed_element_value._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.JSONB, false, true); + + /** + * Create a new routine call instance + */ + public JsTypedElementValue() { + super("js_typed_element_value", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(JSONB value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonEntryMigrate.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonEntryMigrate.java new file mode 100644 index 0000000..d0c2d9f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonEntryMigrate.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonEntryMigrate extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.json_entry_migrate.jsonb_entry. + */ + public static final Parameter JSONB_ENTRY = + Internal.createParameter("jsonb_entry", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.json_entry_migrate.out_composition_name. + */ + public static final Parameter OUT_COMPOSITION_NAME = + Internal.createParameter("out_composition_name", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_entry_migrate.out_new_entry. + */ + public static final Parameter OUT_NEW_ENTRY = + Internal.createParameter("out_new_entry", SQLDataType.JSONB, false, false); + + /** + * Create a new routine call instance + */ + public JsonEntryMigrate() { + super("json_entry_migrate", Ehr.EHR); + + addInParameter(JSONB_ENTRY); + addOutParameter(OUT_COMPOSITION_NAME); + addOutParameter(OUT_NEW_ENTRY); + } + + /** + * Set the jsonb_entry parameter IN value to the routine + */ + public void setJsonbEntry(JSONB value) { + setValue(JSONB_ENTRY, value); + } + + /** + * Get the out_composition_name parameter OUT value from the + * routine + */ + public String getOutCompositionName() { + return get(OUT_COMPOSITION_NAME); + } + + /** + * Get the out_new_entry parameter OUT value from the routine + */ + public JSONB getOutNewEntry() { + return get(OUT_NEW_ENTRY); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified1.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified1.java new file mode 100644 index 0000000..720aa25 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified1.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonPartyIdentified1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.json_party_identified.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.json_party_identified.name. + */ + public static final Parameter NAME = Internal.createParameter("name", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.refid. + */ + public static final Parameter REFID = Internal.createParameter("refid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.json_party_identified.namespace. + */ + public static final Parameter NAMESPACE = + Internal.createParameter("namespace", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.ref_type. + */ + public static final Parameter REF_TYPE = + Internal.createParameter("ref_type", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public JsonPartyIdentified1() { + super("json_party_identified", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(NAME); + addInParameter(REFID); + addInParameter(NAMESPACE); + addInParameter(REF_TYPE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + setOverloaded(true); + } + + /** + * Set the name parameter IN value to the routine + */ + public void setName_(String value) { + setValue(NAME, value); + } + + /** + * Set the name parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setName_(Field field) { + setField(NAME, field); + } + + /** + * Set the refid parameter IN value to the routine + */ + public void setRefid(UUID value) { + setValue(REFID, value); + } + + /** + * Set the refid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefid(Field field) { + setField(REFID, field); + } + + /** + * Set the namespace parameter IN value to the routine + */ + public void setNamespace(String value) { + setValue(NAMESPACE, value); + } + + /** + * Set the namespace parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setNamespace(Field field) { + setField(NAMESPACE, field); + } + + /** + * Set the ref_type parameter IN value to the routine + */ + public void setRefType(String value) { + setValue(REF_TYPE, value); + } + + /** + * Set the ref_type parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefType(Field field) { + setField(REF_TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified2.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified2.java new file mode 100644 index 0000000..e16d7e9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyIdentified2.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonPartyIdentified2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.json_party_identified.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.json_party_identified.name. + */ + public static final Parameter NAME = Internal.createParameter("name", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.refid. + */ + public static final Parameter REFID = Internal.createParameter("refid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.json_party_identified.namespace. + */ + public static final Parameter NAMESPACE = + Internal.createParameter("namespace", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.ref_type. + */ + public static final Parameter REF_TYPE = + Internal.createParameter("ref_type", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_identified.objectid_type. + */ + public static final Parameter OBJECTID_TYPE = Internal.createParameter( + "objectid_type", + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType.class), + false, + false); + + /** + * Create a new routine call instance + */ + public JsonPartyIdentified2() { + super("json_party_identified", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(NAME); + addInParameter(REFID); + addInParameter(NAMESPACE); + addInParameter(REF_TYPE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + addInParameter(OBJECTID_TYPE); + setOverloaded(true); + } + + /** + * Set the name parameter IN value to the routine + */ + public void setName_(String value) { + setValue(NAME, value); + } + + /** + * Set the name parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setName_(Field field) { + setField(NAME, field); + } + + /** + * Set the refid parameter IN value to the routine + */ + public void setRefid(UUID value) { + setValue(REFID, value); + } + + /** + * Set the refid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefid(Field field) { + setField(REFID, field); + } + + /** + * Set the namespace parameter IN value to the routine + */ + public void setNamespace(String value) { + setValue(NAMESPACE, value); + } + + /** + * Set the namespace parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setNamespace(Field field) { + setField(NAMESPACE, field); + } + + /** + * Set the ref_type parameter IN value to the routine + */ + public void setRefType(String value) { + setValue(REF_TYPE, value); + } + + /** + * Set the ref_type parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefType(Field field) { + setField(REF_TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } + + /** + * Set the objectid_type parameter IN value to the routine + */ + public void setObjectidType(PartyRefIdType value) { + setValue(OBJECTID_TYPE, value); + } + + /** + * Set the objectid_type parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setObjectidType(Field field) { + setField(OBJECTID_TYPE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyRelated.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyRelated.java new file mode 100644 index 0000000..8bbd288 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartyRelated.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonPartyRelated extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.json_party_related.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.json_party_related.name. + */ + public static final Parameter NAME = Internal.createParameter("name", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_related.refid. + */ + public static final Parameter REFID = Internal.createParameter("refid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.json_party_related.namespace. + */ + public static final Parameter NAMESPACE = + Internal.createParameter("namespace", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_related.ref_type. + */ + public static final Parameter REF_TYPE = + Internal.createParameter("ref_type", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_related.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_related.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_related.objectid_type. + */ + public static final Parameter OBJECTID_TYPE = Internal.createParameter( + "objectid_type", + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType.class), + false, + false); + + /** + * The parameter ehr.json_party_related.relationship. + */ + public static final Parameter RELATIONSHIP = Internal.createParameter( + "relationship", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + false, + false); + + /** + * Create a new routine call instance + */ + public JsonPartyRelated() { + super("json_party_related", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(NAME); + addInParameter(REFID); + addInParameter(NAMESPACE); + addInParameter(REF_TYPE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + addInParameter(OBJECTID_TYPE); + addInParameter(RELATIONSHIP); + } + + /** + * Set the name parameter IN value to the routine + */ + public void setName_(String value) { + setValue(NAME, value); + } + + /** + * Set the name parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setName_(Field field) { + setField(NAME, field); + } + + /** + * Set the refid parameter IN value to the routine + */ + public void setRefid(UUID value) { + setValue(REFID, value); + } + + /** + * Set the refid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefid(Field field) { + setField(REFID, field); + } + + /** + * Set the namespace parameter IN value to the routine + */ + public void setNamespace(String value) { + setValue(NAMESPACE, value); + } + + /** + * Set the namespace parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setNamespace(Field field) { + setField(NAMESPACE, field); + } + + /** + * Set the ref_type parameter IN value to the routine + */ + public void setRefType(String value) { + setValue(REF_TYPE, value); + } + + /** + * Set the ref_type parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefType(Field field) { + setField(REF_TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } + + /** + * Set the objectid_type parameter IN value to the routine + */ + public void setObjectidType(PartyRefIdType value) { + setValue(OBJECTID_TYPE, value); + } + + /** + * Set the objectid_type parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setObjectidType(Field field) { + setField(OBJECTID_TYPE, field); + } + + /** + * Set the relationship parameter IN value to the routine + */ + public void setRelationship(DvCodedTextRecord value) { + setValue(RELATIONSHIP, value); + } + + /** + * Set the relationship parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setRelationship(Field field) { + setField(RELATIONSHIP, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartySelf.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartySelf.java new file mode 100644 index 0000000..8474350 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonPartySelf.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonPartySelf extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.json_party_self.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.json_party_self.refid. + */ + public static final Parameter REFID = Internal.createParameter("refid", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.json_party_self.namespace. + */ + public static final Parameter NAMESPACE = + Internal.createParameter("namespace", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_self.ref_type. + */ + public static final Parameter REF_TYPE = + Internal.createParameter("ref_type", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_self.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_self.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.json_party_self.objectid_type. + */ + public static final Parameter OBJECTID_TYPE = Internal.createParameter( + "objectid_type", + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType.class), + false, + false); + + /** + * Create a new routine call instance + */ + public JsonPartySelf() { + super("json_party_self", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(REFID); + addInParameter(NAMESPACE); + addInParameter(REF_TYPE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + addInParameter(OBJECTID_TYPE); + } + + /** + * Set the refid parameter IN value to the routine + */ + public void setRefid(UUID value) { + setValue(REFID, value); + } + + /** + * Set the refid parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefid(Field field) { + setField(REFID, field); + } + + /** + * Set the namespace parameter IN value to the routine + */ + public void setNamespace(String value) { + setValue(NAMESPACE, value); + } + + /** + * Set the namespace parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setNamespace(Field field) { + setField(NAMESPACE, field); + } + + /** + * Set the ref_type parameter IN value to the routine + */ + public void setRefType(String value) { + setValue(REF_TYPE, value); + } + + /** + * Set the ref_type parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefType(Field field) { + setField(REF_TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } + + /** + * Set the objectid_type parameter IN value to the routine + */ + public void setObjectidType(PartyRefIdType value) { + setValue(OBJECTID_TYPE, value); + } + + /** + * Set the objectid_type parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setObjectidType(Field field) { + setField(OBJECTID_TYPE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPath.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPath.java new file mode 100644 index 0000000..e769ddb --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPath.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonbExtractPath extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.jsonb_extract_path.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.jsonb_extract_path.from_json. + */ + public static final Parameter FROM_JSON = + Internal.createParameter("from_json", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.jsonb_extract_path.path_elems. + */ + public static final Parameter PATH_ELEMS = + Internal.createParameter("path_elems", SQLDataType.CLOB.array(), false, false); + + /** + * Create a new routine call instance + */ + public JsonbExtractPath() { + super("jsonb_extract_path", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(FROM_JSON); + addInParameter(PATH_ELEMS); + } + + /** + * Set the from_json parameter IN value to the routine + */ + public void setFromJson(JSONB value) { + setValue(FROM_JSON, value); + } + + /** + * Set the from_json parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setFromJson(Field field) { + setField(FROM_JSON, field); + } + + /** + * Set the path_elems parameter IN value to the routine + */ + public void setPathElems(String[] value) { + setValue(PATH_ELEMS, value); + } + + /** + * Set the path_elems parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setPathElems(Field field) { + setField(PATH_ELEMS, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPathText.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPathText.java new file mode 100644 index 0000000..aa1327b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/JsonbExtractPathText.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonbExtractPathText extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.jsonb_extract_path_text.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.jsonb_extract_path_text.from_json. + */ + public static final Parameter FROM_JSON = + Internal.createParameter("from_json", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.jsonb_extract_path_text.path_elems. + */ + public static final Parameter PATH_ELEMS = + Internal.createParameter("path_elems", SQLDataType.CLOB.array(), false, false); + + /** + * Create a new routine call instance + */ + public JsonbExtractPathText() { + super("jsonb_extract_path_text", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(FROM_JSON); + addInParameter(PATH_ELEMS); + } + + /** + * Set the from_json parameter IN value to the routine + */ + public void setFromJson(JSONB value) { + setValue(FROM_JSON, value); + } + + /** + * Set the from_json parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setFromJson(Field field) { + setField(FROM_JSON, field); + } + + /** + * Set the path_elems parameter IN value to the routine + */ + public void setPathElems(String[] value) { + setValue(PATH_ELEMS, value); + } + + /** + * Set the path_elems parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setPathElems(Field field) { + setField(PATH_ELEMS, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MapChangeTypeToCodestring.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MapChangeTypeToCodestring.java new file mode 100644 index 0000000..7e6b646 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MapChangeTypeToCodestring.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MapChangeTypeToCodestring extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter + * ehr.map_change_type_to_codestring.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.map_change_type_to_codestring.literal. + */ + public static final Parameter LITERAL = Internal.createParameter("literal", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public MapChangeTypeToCodestring() { + super("map_change_type_to_codestring", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(LITERAL); + } + + /** + * Set the literal parameter IN value to the routine + */ + public void setLiteral(String value) { + setValue(LITERAL, value); + } + + /** + * Set the literal parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setLiteral(Field field) { + setField(LITERAL, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateConceptToDvCodedText.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateConceptToDvCodedText.java new file mode 100644 index 0000000..03d4572 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateConceptToDvCodedText.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrateConceptToDvCodedText extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter + * ehr.migrate_concept_to_dv_coded_text.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter( + "RETURN_VALUE", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + false, + false); + + /** + * The parameter + * ehr.migrate_concept_to_dv_coded_text.concept_id. + */ + public static final Parameter CONCEPT_ID = + Internal.createParameter("concept_id", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public MigrateConceptToDvCodedText() { + super( + "migrate_concept_to_dv_coded_text", + Ehr.EHR, + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType()); + + setReturnParameter(RETURN_VALUE); + addInParameter(CONCEPT_ID); + } + + /** + * Set the concept_id parameter IN value to the routine + */ + public void setConceptId(UUID value) { + setValue(CONCEPT_ID, value); + } + + /** + * Set the concept_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setConceptId(Field field) { + setField(CONCEPT_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateFolderAudit.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateFolderAudit.java new file mode 100644 index 0000000..4615b75 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateFolderAudit.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrateFolderAudit extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.migrate_folder_audit.ret_id. + */ + public static final Parameter RET_ID = Internal.createParameter("ret_id", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public MigrateFolderAudit() { + super("migrate_folder_audit", Ehr.EHR); + + addOutParameter(RET_ID); + } + + /** + * Get the ret_id parameter OUT value from the routine + */ + public UUID getRetId() { + return get(RET_ID); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationFunction.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationFunction.java new file mode 100644 index 0000000..1680fad --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationFunction.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrateParticipationFunction extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter + * ehr.migrate_participation_function.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter( + "RETURN_VALUE", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + false, + false); + + /** + * The parameter ehr.migrate_participation_function.mode. + */ + public static final Parameter MODE = Internal.createParameter("mode", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public MigrateParticipationFunction() { + super( + "migrate_participation_function", + Ehr.EHR, + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType()); + + setReturnParameter(RETURN_VALUE); + addInParameter(MODE); + } + + /** + * Set the mode parameter IN value to the routine + */ + public void setMode(String value) { + setValue(MODE, value); + } + + /** + * Set the mode parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setMode(Field field) { + setField(MODE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationMode.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationMode.java new file mode 100644 index 0000000..a3cf491 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrateParticipationMode.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrateParticipationMode extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.migrate_participation_mode.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter( + "RETURN_VALUE", + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + false, + false); + + /** + * The parameter ehr.migrate_participation_mode.mode. + */ + public static final Parameter MODE = Internal.createParameter("mode", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public MigrateParticipationMode() { + super( + "migrate_participation_mode", + Ehr.EHR, + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType()); + + setReturnParameter(RETURN_VALUE); + addInParameter(MODE); + } + + /** + * Set the mode parameter IN value to the routine + */ + public void setMode(String value) { + setValue(MODE, value); + } + + /** + * Set the mode parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setMode(Field field) { + setField(MODE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditCommitter.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditCommitter.java new file mode 100644 index 0000000..1fb9d73 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditCommitter.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrationAuditCommitter extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.migration_audit_committer.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.migration_audit_committer.committer. + */ + public static final Parameter COMMITTER = + Internal.createParameter("committer", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public MigrationAuditCommitter() { + super("migration_audit_committer", Ehr.EHR, SQLDataType.UUID); + + setReturnParameter(RETURN_VALUE); + addInParameter(COMMITTER); + } + + /** + * Set the committer parameter IN value to the routine + */ + public void setCommitter(UUID value) { + setValue(COMMITTER, value); + } + + /** + * Set the committer parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setCommitter(Field field) { + setField(COMMITTER, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditSystemId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditSystemId.java new file mode 100644 index 0000000..8cced2a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditSystemId.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrationAuditSystemId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.migration_audit_system_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.UUID, false, false); + + /** + * The parameter ehr.migration_audit_system_id.system_id. + */ + public static final Parameter SYSTEM_ID = + Internal.createParameter("system_id", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public MigrationAuditSystemId() { + super("migration_audit_system_id", Ehr.EHR, SQLDataType.UUID); + + setReturnParameter(RETURN_VALUE); + addInParameter(SYSTEM_ID); + } + + /** + * Set the system_id parameter IN value to the routine + */ + public void setSystemId(UUID value) { + setValue(SYSTEM_ID, value); + } + + /** + * Set the system_id parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setSystemId(Field field) { + setField(SYSTEM_ID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditTzid.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditTzid.java new file mode 100644 index 0000000..3837a8e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/MigrationAuditTzid.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class MigrationAuditTzid extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.migration_audit_tzid.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.migration_audit_tzid.time_committed_tzid. + */ + public static final Parameter TIME_COMMITTED_TZID = + Internal.createParameter("time_committed_tzid", SQLDataType.CLOB, false, false); + + /** + * Create a new routine call instance + */ + public MigrationAuditTzid() { + super("migration_audit_tzid", Ehr.EHR, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(TIME_COMMITTED_TZID); + } + + /** + * Set the time_committed_tzid parameter IN value to the + * routine + */ + public void setTimeCommittedTzid(String value) { + setValue(TIME_COMMITTED_TZID, value); + } + + /** + * Set the time_committed_tzid parameter to the function to be + * used with a {@link org.jooq.Select} statement + */ + public void setTimeCommittedTzid(Field field) { + setField(TIME_COMMITTED_TZID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/NextSysTenant.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/NextSysTenant.java new file mode 100644 index 0000000..8f4295a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/NextSysTenant.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class NextSysTenant extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.next_sys_tenant.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.SMALLINT, false, false); + + /** + * Create a new routine call instance + */ + public NextSysTenant() { + super("next_sys_tenant", Ehr.EHR, SQLDataType.SMALLINT); + + setReturnParameter(RETURN_VALUE); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/ObjectVersionId.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/ObjectVersionId.java new file mode 100644 index 0000000..c032651 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/ObjectVersionId.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class ObjectVersionId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.object_version_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSON, false, false); + + /** + * The parameter ehr.object_version_id._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.UUID, false, true); + + /** + * The parameter ehr.object_version_id._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter ehr.object_version_id._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.INTEGER, false, true); + + /** + * Create a new routine call instance + */ + public ObjectVersionId() { + super("object_version_id", Ehr.EHR, SQLDataType.JSON); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(UUID value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__1(Field field) { + setField(_1, field); + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__2(Field field) { + setField(_2, field); + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(Integer value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void set__3(Field field) { + setField(_3, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyRef.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyRef.java new file mode 100644 index 0000000..db314b9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyRef.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PartyRef extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.party_ref.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.JSONB, false, false); + + /** + * The parameter ehr.party_ref.namespace. + */ + public static final Parameter NAMESPACE = + Internal.createParameter("namespace", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.party_ref.ref_type. + */ + public static final Parameter REF_TYPE = + Internal.createParameter("ref_type", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.party_ref.scheme. + */ + public static final Parameter SCHEME = Internal.createParameter("scheme", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.party_ref.id_value. + */ + public static final Parameter ID_VALUE = + Internal.createParameter("id_value", SQLDataType.CLOB, false, false); + + /** + * The parameter ehr.party_ref.objectid_type. + */ + public static final Parameter OBJECTID_TYPE = Internal.createParameter( + "objectid_type", + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType.class), + false, + false); + + /** + * Create a new routine call instance + */ + public PartyRef() { + super("party_ref", Ehr.EHR, SQLDataType.JSONB); + + setReturnParameter(RETURN_VALUE); + addInParameter(NAMESPACE); + addInParameter(REF_TYPE); + addInParameter(SCHEME); + addInParameter(ID_VALUE); + addInParameter(OBJECTID_TYPE); + } + + /** + * Set the namespace parameter IN value to the routine + */ + public void setNamespace(String value) { + setValue(NAMESPACE, value); + } + + /** + * Set the namespace parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setNamespace(Field field) { + setField(NAMESPACE, field); + } + + /** + * Set the ref_type parameter IN value to the routine + */ + public void setRefType(String value) { + setValue(REF_TYPE, value); + } + + /** + * Set the ref_type parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setRefType(Field field) { + setField(REF_TYPE, field); + } + + /** + * Set the scheme parameter IN value to the routine + */ + public void setScheme(String value) { + setValue(SCHEME, value); + } + + /** + * Set the scheme parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setScheme(Field field) { + setField(SCHEME, field); + } + + /** + * Set the id_value parameter IN value to the routine + */ + public void setIdValue(String value) { + setValue(ID_VALUE, value); + } + + /** + * Set the id_value parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public void setIdValue(Field field) { + setField(ID_VALUE, field); + } + + /** + * Set the objectid_type parameter IN value to the routine + */ + public void setObjectidType(PartyRefIdType value) { + setValue(OBJECTID_TYPE, value); + } + + /** + * Set the objectid_type parameter to the function to be used + * with a {@link org.jooq.Select} statement + */ + public void setObjectidType(Field field) { + setField(OBJECTID_TYPE, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyUsage.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyUsage.java new file mode 100644 index 0000000..864941a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/routines/PartyUsage.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.routines; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PartyUsage extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter ehr.party_usage.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = + Internal.createParameter("RETURN_VALUE", SQLDataType.BIGINT, false, false); + + /** + * The parameter ehr.party_usage.party_uuid. + */ + public static final Parameter PARTY_UUID = + Internal.createParameter("party_uuid", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public PartyUsage() { + super("party_usage", Ehr.EHR, SQLDataType.BIGINT); + + setReturnParameter(RETURN_VALUE); + addInParameter(PARTY_UUID); + } + + /** + * Set the party_uuid parameter IN value to the routine + */ + public void setPartyUuid(UUID value) { + setValue(PARTY_UUID, value); + } + + /** + * Set the party_uuid parameter to the function to be used with + * a {@link org.jooq.Select} statement + */ + public void setPartyUuid(Field field) { + setField(PARTY_UUID, field); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Access.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Access.java new file mode 100644 index 0000000..f2cf011 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Access.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AccessRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * defines the modality for accessing an com.ethercis.ehr (security strategy + * implementation) + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Access extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.access + */ + public static final Access ACCESS = new Access(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AccessRecord.class; + } + + /** + * The column ehr.access.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.access.settings. + */ + public final TableField SETTINGS = + createField(DSL.name("settings"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.access.scheme. + */ + public final TableField SCHEME = createField(DSL.name("scheme"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.access.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Access(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Access(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment( + "defines the modality for accessing an com.ethercis.ehr (security strategy implementation)"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.access table reference + */ + public Access(String alias) { + this(DSL.name(alias), ACCESS); + } + + /** + * Create an aliased ehr.access table reference + */ + public Access(Name alias) { + this(alias, ACCESS); + } + + /** + * Create a ehr.access table reference + */ + public Access() { + this(DSL.name("access"), null); + } + + public Access(Table child, ForeignKey key) { + super(child, key, ACCESS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACCESS_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.ACCESS__ACCESS_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.ACCESS__ACCESS_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Access as(String alias) { + return new Access(DSL.name(alias), this); + } + + @Override + public Access as(Name alias) { + return new Access(alias, this); + } + + @Override + public Access as(Table alias) { + return new Access(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Access rename(String name) { + return new Access(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Access rename(Name name) { + return new Access(name, null); + } + + /** + * Rename this table + */ + @Override + public Access rename(Table name) { + return new Access(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAttestation.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAttestation.java new file mode 100644 index 0000000..f348b66 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAttestation.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAttestationRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteAttestation extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_attestation + */ + public static final AdminDeleteAttestation ADMIN_DELETE_ATTESTATION = new AdminDeleteAttestation(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteAttestationRecord.class; + } + + /** + * The column ehr.admin_delete_attestation.audit. + */ + public final TableField AUDIT = + createField(DSL.name("audit"), SQLDataType.UUID, this, ""); + + private AdminDeleteAttestation(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteAttestation(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_attestation table + * reference + */ + public AdminDeleteAttestation(String alias) { + this(DSL.name(alias), ADMIN_DELETE_ATTESTATION); + } + + /** + * Create an aliased ehr.admin_delete_attestation table + * reference + */ + public AdminDeleteAttestation(Name alias) { + this(alias, ADMIN_DELETE_ATTESTATION); + } + + /** + * Create a ehr.admin_delete_attestation table reference + */ + public AdminDeleteAttestation() { + this(DSL.name("admin_delete_attestation"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteAttestation as(String alias) { + return new AdminDeleteAttestation(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteAttestation as(Name alias) { + return new AdminDeleteAttestation(alias, this, parameters); + } + + @Override + public AdminDeleteAttestation as(Table alias) { + return new AdminDeleteAttestation(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteAttestation rename(String name) { + return new AdminDeleteAttestation(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteAttestation rename(Name name) { + return new AdminDeleteAttestation(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteAttestation rename(Table name) { + return new AdminDeleteAttestation(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteAttestation call(UUID attestRefInput) { + AdminDeleteAttestation result = new AdminDeleteAttestation( + DSL.name("admin_delete_attestation"), null, new Field[] {DSL.val(attestRefInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteAttestation call(Field attestRefInput) { + AdminDeleteAttestation result = + new AdminDeleteAttestation(DSL.name("admin_delete_attestation"), null, new Field[] {attestRefInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAudit.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAudit.java new file mode 100644 index 0000000..a2852dd --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteAudit.java @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteAuditRecord; +import org.jooq.Field; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteAudit extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_audit + */ + public static final AdminDeleteAudit ADMIN_DELETE_AUDIT = new AdminDeleteAudit(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteAuditRecord.class; + } + + /** + * The column ehr.admin_delete_audit.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.admin_delete_audit.party. + */ + public final TableField PARTY = + createField(DSL.name("party"), SQLDataType.UUID, this, ""); + + private AdminDeleteAudit(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteAudit(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_audit table reference + */ + public AdminDeleteAudit(String alias) { + this(DSL.name(alias), ADMIN_DELETE_AUDIT); + } + + /** + * Create an aliased ehr.admin_delete_audit table reference + */ + public AdminDeleteAudit(Name alias) { + this(alias, ADMIN_DELETE_AUDIT); + } + + /** + * Create a ehr.admin_delete_audit table reference + */ + public AdminDeleteAudit() { + this(DSL.name("admin_delete_audit"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteAudit as(String alias) { + return new AdminDeleteAudit(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteAudit as(Name alias) { + return new AdminDeleteAudit(alias, this, parameters); + } + + @Override + public AdminDeleteAudit as(Table alias) { + return new AdminDeleteAudit(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteAudit rename(String name) { + return new AdminDeleteAudit(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteAudit rename(Name name) { + return new AdminDeleteAudit(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteAudit rename(Table name) { + return new AdminDeleteAudit(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteAudit call(UUID auditInput) { + AdminDeleteAudit result = new AdminDeleteAudit( + DSL.name("admin_delete_audit"), null, new Field[] {DSL.val(auditInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteAudit call(Field auditInput) { + AdminDeleteAudit result = new AdminDeleteAudit(DSL.name("admin_delete_audit"), null, new Field[] {auditInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteComposition.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteComposition.java new file mode 100644 index 0000000..0b33b44 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteComposition.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionRecord; +import org.jooq.Field; +import org.jooq.Function5; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteComposition extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_composition + */ + public static final AdminDeleteComposition ADMIN_DELETE_COMPOSITION = new AdminDeleteComposition(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteCompositionRecord.class; + } + + /** + * The column ehr.admin_delete_composition.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.admin_delete_composition.contribution. + */ + public final TableField CONTRIBUTION = + createField(DSL.name("contribution"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.admin_delete_composition.party. + */ + public final TableField PARTY = + createField(DSL.name("party"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.admin_delete_composition.audit. + */ + public final TableField AUDIT = + createField(DSL.name("audit"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.admin_delete_composition.attestation. + */ + public final TableField ATTESTATION = + createField(DSL.name("attestation"), SQLDataType.UUID, this, ""); + + private AdminDeleteComposition(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteComposition(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_composition table + * reference + */ + public AdminDeleteComposition(String alias) { + this(DSL.name(alias), ADMIN_DELETE_COMPOSITION); + } + + /** + * Create an aliased ehr.admin_delete_composition table + * reference + */ + public AdminDeleteComposition(Name alias) { + this(alias, ADMIN_DELETE_COMPOSITION); + } + + /** + * Create a ehr.admin_delete_composition table reference + */ + public AdminDeleteComposition() { + this(DSL.name("admin_delete_composition"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteComposition as(String alias) { + return new AdminDeleteComposition(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteComposition as(Name alias) { + return new AdminDeleteComposition(alias, this, parameters); + } + + @Override + public AdminDeleteComposition as(Table alias) { + return new AdminDeleteComposition(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteComposition rename(String name) { + return new AdminDeleteComposition(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteComposition rename(Name name) { + return new AdminDeleteComposition(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteComposition rename(Table name) { + return new AdminDeleteComposition(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteComposition call(UUID compoIdInput) { + AdminDeleteComposition result = new AdminDeleteComposition( + DSL.name("admin_delete_composition"), null, new Field[] {DSL.val(compoIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteComposition call(Field compoIdInput) { + AdminDeleteComposition result = + new AdminDeleteComposition(DSL.name("admin_delete_composition"), null, new Field[] {compoIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function5 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function5 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteCompositionHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteCompositionHistory.java new file mode 100644 index 0000000..652b69f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteCompositionHistory.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteCompositionHistoryRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteCompositionHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of + * ehr.admin_delete_composition_history + */ + public static final AdminDeleteCompositionHistory ADMIN_DELETE_COMPOSITION_HISTORY = + new AdminDeleteCompositionHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteCompositionHistoryRecord.class; + } + + /** + * The column ehr.admin_delete_composition_history.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + private AdminDeleteCompositionHistory(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteCompositionHistory( + Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_composition_history table + * reference + */ + public AdminDeleteCompositionHistory(String alias) { + this(DSL.name(alias), ADMIN_DELETE_COMPOSITION_HISTORY); + } + + /** + * Create an aliased ehr.admin_delete_composition_history table + * reference + */ + public AdminDeleteCompositionHistory(Name alias) { + this(alias, ADMIN_DELETE_COMPOSITION_HISTORY); + } + + /** + * Create a ehr.admin_delete_composition_history table + * reference + */ + public AdminDeleteCompositionHistory() { + this(DSL.name("admin_delete_composition_history"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteCompositionHistory as(String alias) { + return new AdminDeleteCompositionHistory(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteCompositionHistory as(Name alias) { + return new AdminDeleteCompositionHistory(alias, this, parameters); + } + + @Override + public AdminDeleteCompositionHistory as(Table alias) { + return new AdminDeleteCompositionHistory(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteCompositionHistory rename(String name) { + return new AdminDeleteCompositionHistory(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteCompositionHistory rename(Name name) { + return new AdminDeleteCompositionHistory(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteCompositionHistory rename(Table name) { + return new AdminDeleteCompositionHistory(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteCompositionHistory call(UUID compoInput) { + AdminDeleteCompositionHistory result = new AdminDeleteCompositionHistory( + DSL.name("admin_delete_composition_history"), null, new Field[] {DSL.val(compoInput, SQLDataType.UUID) + }); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteCompositionHistory call(Field compoInput) { + AdminDeleteCompositionHistory result = new AdminDeleteCompositionHistory( + DSL.name("admin_delete_composition_history"), null, new Field[] {compoInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteContribution.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteContribution.java new file mode 100644 index 0000000..9181e84 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteContribution.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteContributionRecord; +import org.jooq.Field; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteContribution extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_contribution + */ + public static final AdminDeleteContribution ADMIN_DELETE_CONTRIBUTION = new AdminDeleteContribution(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteContributionRecord.class; + } + + /** + * The column ehr.admin_delete_contribution.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.admin_delete_contribution.audit. + */ + public final TableField AUDIT = + createField(DSL.name("audit"), SQLDataType.UUID, this, ""); + + private AdminDeleteContribution(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteContribution(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_contribution table + * reference + */ + public AdminDeleteContribution(String alias) { + this(DSL.name(alias), ADMIN_DELETE_CONTRIBUTION); + } + + /** + * Create an aliased ehr.admin_delete_contribution table + * reference + */ + public AdminDeleteContribution(Name alias) { + this(alias, ADMIN_DELETE_CONTRIBUTION); + } + + /** + * Create a ehr.admin_delete_contribution table reference + */ + public AdminDeleteContribution() { + this(DSL.name("admin_delete_contribution"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteContribution as(String alias) { + return new AdminDeleteContribution(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteContribution as(Name alias) { + return new AdminDeleteContribution(alias, this, parameters); + } + + @Override + public AdminDeleteContribution as(Table alias) { + return new AdminDeleteContribution(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteContribution rename(String name) { + return new AdminDeleteContribution(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteContribution rename(Name name) { + return new AdminDeleteContribution(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteContribution rename(Table name) { + return new AdminDeleteContribution(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteContribution call(UUID contribIdInput) { + AdminDeleteContribution result = new AdminDeleteContribution( + DSL.name("admin_delete_contribution"), null, new Field[] {DSL.val(contribIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteContribution call(Field contribIdInput) { + AdminDeleteContribution result = + new AdminDeleteContribution(DSL.name("admin_delete_contribution"), null, new Field[] {contribIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhr.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhr.java new file mode 100644 index 0000000..5811156 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhr.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrRecord; +import org.jooq.Field; +import org.jooq.Function3; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEhr extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_ehr + */ + public static final AdminDeleteEhr ADMIN_DELETE_EHR = new AdminDeleteEhr(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteEhrRecord.class; + } + + /** + * The column ehr.admin_delete_ehr.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.admin_delete_ehr.status_audit. + */ + public final TableField STATUS_AUDIT = + createField(DSL.name("status_audit"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.admin_delete_ehr.status_party. + */ + public final TableField STATUS_PARTY = + createField(DSL.name("status_party"), SQLDataType.UUID, this, ""); + + private AdminDeleteEhr(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteEhr(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_ehr table reference + */ + public AdminDeleteEhr(String alias) { + this(DSL.name(alias), ADMIN_DELETE_EHR); + } + + /** + * Create an aliased ehr.admin_delete_ehr table reference + */ + public AdminDeleteEhr(Name alias) { + this(alias, ADMIN_DELETE_EHR); + } + + /** + * Create a ehr.admin_delete_ehr table reference + */ + public AdminDeleteEhr() { + this(DSL.name("admin_delete_ehr"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteEhr as(String alias) { + return new AdminDeleteEhr(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteEhr as(Name alias) { + return new AdminDeleteEhr(alias, this, parameters); + } + + @Override + public AdminDeleteEhr as(Table alias) { + return new AdminDeleteEhr(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhr rename(String name) { + return new AdminDeleteEhr(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhr rename(Name name) { + return new AdminDeleteEhr(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhr rename(Table name) { + return new AdminDeleteEhr(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteEhr call(UUID ehrIdInput) { + AdminDeleteEhr result = new AdminDeleteEhr( + DSL.name("admin_delete_ehr"), null, new Field[] {DSL.val(ehrIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteEhr call(Field ehrIdInput) { + AdminDeleteEhr result = new AdminDeleteEhr(DSL.name("admin_delete_ehr"), null, new Field[] {ehrIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrFull.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrFull.java new file mode 100644 index 0000000..5cf2ed0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrFull.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrFullRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEhrFull extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_ehr_full + */ + public static final AdminDeleteEhrFull ADMIN_DELETE_EHR_FULL = new AdminDeleteEhrFull(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteEhrFullRecord.class; + } + + /** + * The column ehr.admin_delete_ehr_full.deleted. + */ + public final TableField DELETED = + createField(DSL.name("deleted"), SQLDataType.BOOLEAN, this, ""); + + private AdminDeleteEhrFull(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteEhrFull(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_ehr_full table reference + */ + public AdminDeleteEhrFull(String alias) { + this(DSL.name(alias), ADMIN_DELETE_EHR_FULL); + } + + /** + * Create an aliased ehr.admin_delete_ehr_full table reference + */ + public AdminDeleteEhrFull(Name alias) { + this(alias, ADMIN_DELETE_EHR_FULL); + } + + /** + * Create a ehr.admin_delete_ehr_full table reference + */ + public AdminDeleteEhrFull() { + this(DSL.name("admin_delete_ehr_full"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteEhrFull as(String alias) { + return new AdminDeleteEhrFull(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteEhrFull as(Name alias) { + return new AdminDeleteEhrFull(alias, this, parameters); + } + + @Override + public AdminDeleteEhrFull as(Table alias) { + return new AdminDeleteEhrFull(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhrFull rename(String name) { + return new AdminDeleteEhrFull(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhrFull rename(Name name) { + return new AdminDeleteEhrFull(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhrFull rename(Table name) { + return new AdminDeleteEhrFull(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteEhrFull call(UUID ehrIdParam) { + AdminDeleteEhrFull result = new AdminDeleteEhrFull( + DSL.name("admin_delete_ehr_full"), null, new Field[] {DSL.val(ehrIdParam, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteEhrFull call(Field ehrIdParam) { + AdminDeleteEhrFull result = + new AdminDeleteEhrFull(DSL.name("admin_delete_ehr_full"), null, new Field[] {ehrIdParam}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrHistory.java new file mode 100644 index 0000000..9f9213c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEhrHistory.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEhrHistoryRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEhrHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_ehr_history + */ + public static final AdminDeleteEhrHistory ADMIN_DELETE_EHR_HISTORY = new AdminDeleteEhrHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteEhrHistoryRecord.class; + } + + /** + * The column ehr.admin_delete_ehr_history.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + private AdminDeleteEhrHistory(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteEhrHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_ehr_history table + * reference + */ + public AdminDeleteEhrHistory(String alias) { + this(DSL.name(alias), ADMIN_DELETE_EHR_HISTORY); + } + + /** + * Create an aliased ehr.admin_delete_ehr_history table + * reference + */ + public AdminDeleteEhrHistory(Name alias) { + this(alias, ADMIN_DELETE_EHR_HISTORY); + } + + /** + * Create a ehr.admin_delete_ehr_history table reference + */ + public AdminDeleteEhrHistory() { + this(DSL.name("admin_delete_ehr_history"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteEhrHistory as(String alias) { + return new AdminDeleteEhrHistory(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteEhrHistory as(Name alias) { + return new AdminDeleteEhrHistory(alias, this, parameters); + } + + @Override + public AdminDeleteEhrHistory as(Table alias) { + return new AdminDeleteEhrHistory(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhrHistory rename(String name) { + return new AdminDeleteEhrHistory(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhrHistory rename(Name name) { + return new AdminDeleteEhrHistory(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEhrHistory rename(Table name) { + return new AdminDeleteEhrHistory(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteEhrHistory call(UUID ehrIdInput) { + AdminDeleteEhrHistory result = new AdminDeleteEhrHistory( + DSL.name("admin_delete_ehr_history"), null, new Field[] {DSL.val(ehrIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteEhrHistory call(Field ehrIdInput) { + AdminDeleteEhrHistory result = + new AdminDeleteEhrHistory(DSL.name("admin_delete_ehr_history"), null, new Field[] {ehrIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEventContextForCompo.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEventContextForCompo.java new file mode 100644 index 0000000..b9eb158 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteEventContextForCompo.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteEventContextForCompoRecord; +import org.jooq.Field; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEventContextForCompo extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of + * ehr.admin_delete_event_context_for_compo + */ + public static final AdminDeleteEventContextForCompo ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO = + new AdminDeleteEventContextForCompo(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteEventContextForCompoRecord.class; + } + + /** + * The column ehr.admin_delete_event_context_for_compo.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.admin_delete_event_context_for_compo.party. + */ + public final TableField PARTY = + createField(DSL.name("party"), SQLDataType.UUID, this, ""); + + private AdminDeleteEventContextForCompo(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteEventContextForCompo( + Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_event_context_for_compo + * table reference + */ + public AdminDeleteEventContextForCompo(String alias) { + this(DSL.name(alias), ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO); + } + + /** + * Create an aliased ehr.admin_delete_event_context_for_compo + * table reference + */ + public AdminDeleteEventContextForCompo(Name alias) { + this(alias, ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO); + } + + /** + * Create a ehr.admin_delete_event_context_for_compo table + * reference + */ + public AdminDeleteEventContextForCompo() { + this(DSL.name("admin_delete_event_context_for_compo"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteEventContextForCompo as(String alias) { + return new AdminDeleteEventContextForCompo(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteEventContextForCompo as(Name alias) { + return new AdminDeleteEventContextForCompo(alias, this, parameters); + } + + @Override + public AdminDeleteEventContextForCompo as(Table alias) { + return new AdminDeleteEventContextForCompo(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEventContextForCompo rename(String name) { + return new AdminDeleteEventContextForCompo(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEventContextForCompo rename(Name name) { + return new AdminDeleteEventContextForCompo(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteEventContextForCompo rename(Table name) { + return new AdminDeleteEventContextForCompo(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteEventContextForCompo call(UUID compoIdInput) { + AdminDeleteEventContextForCompo result = new AdminDeleteEventContextForCompo( + DSL.name("admin_delete_event_context_for_compo"), + null, + new Field[] {DSL.val(compoIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteEventContextForCompo call(Field compoIdInput) { + AdminDeleteEventContextForCompo result = new AdminDeleteEventContextForCompo( + DSL.name("admin_delete_event_context_for_compo"), null, new Field[] {compoIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatus.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatus.java new file mode 100644 index 0000000..b6d56b4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatus.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusRecord; +import org.jooq.Field; +import org.jooq.Function3; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteStatus extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_status + */ + public static final AdminDeleteStatus ADMIN_DELETE_STATUS = new AdminDeleteStatus(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteStatusRecord.class; + } + + /** + * The column ehr.admin_delete_status.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.admin_delete_status.status_audit. + */ + public final TableField STATUS_AUDIT = + createField(DSL.name("status_audit"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.admin_delete_status.status_party. + */ + public final TableField STATUS_PARTY = + createField(DSL.name("status_party"), SQLDataType.UUID, this, ""); + + private AdminDeleteStatus(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteStatus(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_status table reference + */ + public AdminDeleteStatus(String alias) { + this(DSL.name(alias), ADMIN_DELETE_STATUS); + } + + /** + * Create an aliased ehr.admin_delete_status table reference + */ + public AdminDeleteStatus(Name alias) { + this(alias, ADMIN_DELETE_STATUS); + } + + /** + * Create a ehr.admin_delete_status table reference + */ + public AdminDeleteStatus() { + this(DSL.name("admin_delete_status"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteStatus as(String alias) { + return new AdminDeleteStatus(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteStatus as(Name alias) { + return new AdminDeleteStatus(alias, this, parameters); + } + + @Override + public AdminDeleteStatus as(Table alias) { + return new AdminDeleteStatus(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteStatus rename(String name) { + return new AdminDeleteStatus(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteStatus rename(Name name) { + return new AdminDeleteStatus(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteStatus rename(Table name) { + return new AdminDeleteStatus(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteStatus call(UUID statusIdInput) { + AdminDeleteStatus result = new AdminDeleteStatus( + DSL.name("admin_delete_status"), null, new Field[] {DSL.val(statusIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteStatus call(Field statusIdInput) { + AdminDeleteStatus result = + new AdminDeleteStatus(DSL.name("admin_delete_status"), null, new Field[] {statusIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatusHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatusHistory.java new file mode 100644 index 0000000..482c9b6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteStatusHistory.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteStatusHistoryRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteStatusHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_status_history + */ + public static final AdminDeleteStatusHistory ADMIN_DELETE_STATUS_HISTORY = new AdminDeleteStatusHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteStatusHistoryRecord.class; + } + + /** + * The column ehr.admin_delete_status_history.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER, this, ""); + + private AdminDeleteStatusHistory(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminDeleteStatusHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_status_history table + * reference + */ + public AdminDeleteStatusHistory(String alias) { + this(DSL.name(alias), ADMIN_DELETE_STATUS_HISTORY); + } + + /** + * Create an aliased ehr.admin_delete_status_history table + * reference + */ + public AdminDeleteStatusHistory(Name alias) { + this(alias, ADMIN_DELETE_STATUS_HISTORY); + } + + /** + * Create a ehr.admin_delete_status_history table reference + */ + public AdminDeleteStatusHistory() { + this(DSL.name("admin_delete_status_history"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteStatusHistory as(String alias) { + return new AdminDeleteStatusHistory(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteStatusHistory as(Name alias) { + return new AdminDeleteStatusHistory(alias, this, parameters); + } + + @Override + public AdminDeleteStatusHistory as(Table alias) { + return new AdminDeleteStatusHistory(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteStatusHistory rename(String name) { + return new AdminDeleteStatusHistory(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteStatusHistory rename(Name name) { + return new AdminDeleteStatusHistory(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteStatusHistory rename(Table name) { + return new AdminDeleteStatusHistory(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteStatusHistory call(UUID statusIdInput) { + AdminDeleteStatusHistory result = new AdminDeleteStatusHistory( + DSL.name("admin_delete_status_history"), null, new Field[] {DSL.val(statusIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteStatusHistory call(Field statusIdInput) { + AdminDeleteStatusHistory result = new AdminDeleteStatusHistory( + DSL.name("admin_delete_status_history"), null, new Field[] {statusIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteTenantFull.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteTenantFull.java new file mode 100644 index 0000000..6b3591f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminDeleteTenantFull.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminDeleteTenantFullRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteTenantFull extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_delete_tenant_full + */ + public static final AdminDeleteTenantFull ADMIN_DELETE_TENANT_FULL = new AdminDeleteTenantFull(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminDeleteTenantFullRecord.class; + } + + /** + * The column ehr.admin_delete_tenant_full.deleted. + */ + public final TableField DELETED = + createField(DSL.name("deleted"), SQLDataType.BOOLEAN, this, ""); + + private AdminDeleteTenantFull(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.SMALLINT)}); + } + + private AdminDeleteTenantFull(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_delete_tenant_full table + * reference + */ + public AdminDeleteTenantFull(String alias) { + this(DSL.name(alias), ADMIN_DELETE_TENANT_FULL); + } + + /** + * Create an aliased ehr.admin_delete_tenant_full table + * reference + */ + public AdminDeleteTenantFull(Name alias) { + this(alias, ADMIN_DELETE_TENANT_FULL); + } + + /** + * Create a ehr.admin_delete_tenant_full table reference + */ + public AdminDeleteTenantFull() { + this(DSL.name("admin_delete_tenant_full"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminDeleteTenantFull as(String alias) { + return new AdminDeleteTenantFull(DSL.name(alias), this, parameters); + } + + @Override + public AdminDeleteTenantFull as(Name alias) { + return new AdminDeleteTenantFull(alias, this, parameters); + } + + @Override + public AdminDeleteTenantFull as(Table alias) { + return new AdminDeleteTenantFull(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteTenantFull rename(String name) { + return new AdminDeleteTenantFull(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteTenantFull rename(Name name) { + return new AdminDeleteTenantFull(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminDeleteTenantFull rename(Table name) { + return new AdminDeleteTenantFull(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminDeleteTenantFull call(Short tenantIdParam) { + AdminDeleteTenantFull result = new AdminDeleteTenantFull( + DSL.name("admin_delete_tenant_full"), null, new Field[] {DSL.val(tenantIdParam, SQLDataType.SMALLINT)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminDeleteTenantFull call(Field tenantIdParam) { + AdminDeleteTenantFull result = + new AdminDeleteTenantFull(DSL.name("admin_delete_tenant_full"), null, new Field[] {tenantIdParam}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositions.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositions.java new file mode 100644 index 0000000..fb677ce --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositions.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedCompositions extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_get_linked_compositions + */ + public static final AdminGetLinkedCompositions ADMIN_GET_LINKED_COMPOSITIONS = new AdminGetLinkedCompositions(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminGetLinkedCompositionsRecord.class; + } + + /** + * The column ehr.admin_get_linked_compositions.composition. + */ + public final TableField COMPOSITION = + createField(DSL.name("composition"), SQLDataType.UUID, this, ""); + + private AdminGetLinkedCompositions(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminGetLinkedCompositions( + Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_get_linked_compositions table + * reference + */ + public AdminGetLinkedCompositions(String alias) { + this(DSL.name(alias), ADMIN_GET_LINKED_COMPOSITIONS); + } + + /** + * Create an aliased ehr.admin_get_linked_compositions table + * reference + */ + public AdminGetLinkedCompositions(Name alias) { + this(alias, ADMIN_GET_LINKED_COMPOSITIONS); + } + + /** + * Create a ehr.admin_get_linked_compositions table reference + */ + public AdminGetLinkedCompositions() { + this(DSL.name("admin_get_linked_compositions"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminGetLinkedCompositions as(String alias) { + return new AdminGetLinkedCompositions(DSL.name(alias), this, parameters); + } + + @Override + public AdminGetLinkedCompositions as(Name alias) { + return new AdminGetLinkedCompositions(alias, this, parameters); + } + + @Override + public AdminGetLinkedCompositions as(Table alias) { + return new AdminGetLinkedCompositions(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedCompositions rename(String name) { + return new AdminGetLinkedCompositions(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedCompositions rename(Name name) { + return new AdminGetLinkedCompositions(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedCompositions rename(Table name) { + return new AdminGetLinkedCompositions(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedCompositions call(UUID ehrIdInput) { + AdminGetLinkedCompositions result = new AdminGetLinkedCompositions( + DSL.name("admin_get_linked_compositions"), null, new Field[] {DSL.val(ehrIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedCompositions call(Field ehrIdInput) { + AdminGetLinkedCompositions result = new AdminGetLinkedCompositions( + DSL.name("admin_get_linked_compositions"), null, new Field[] {ehrIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositionsForContrib.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositionsForContrib.java new file mode 100644 index 0000000..647d03c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedCompositionsForContrib.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedCompositionsForContribRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedCompositionsForContrib extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of + * ehr.admin_get_linked_compositions_for_contrib + */ + public static final AdminGetLinkedCompositionsForContrib ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB = + new AdminGetLinkedCompositionsForContrib(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminGetLinkedCompositionsForContribRecord.class; + } + + /** + * The column + * ehr.admin_get_linked_compositions_for_contrib.composition. + */ + public final TableField COMPOSITION = + createField(DSL.name("composition"), SQLDataType.UUID, this, ""); + + private AdminGetLinkedCompositionsForContrib( + Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminGetLinkedCompositionsForContrib( + Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased + * ehr.admin_get_linked_compositions_for_contrib table + * reference + */ + public AdminGetLinkedCompositionsForContrib(String alias) { + this(DSL.name(alias), ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB); + } + + /** + * Create an aliased + * ehr.admin_get_linked_compositions_for_contrib table + * reference + */ + public AdminGetLinkedCompositionsForContrib(Name alias) { + this(alias, ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB); + } + + /** + * Create a ehr.admin_get_linked_compositions_for_contrib table + * reference + */ + public AdminGetLinkedCompositionsForContrib() { + this(DSL.name("admin_get_linked_compositions_for_contrib"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminGetLinkedCompositionsForContrib as(String alias) { + return new AdminGetLinkedCompositionsForContrib(DSL.name(alias), this, parameters); + } + + @Override + public AdminGetLinkedCompositionsForContrib as(Name alias) { + return new AdminGetLinkedCompositionsForContrib(alias, this, parameters); + } + + @Override + public AdminGetLinkedCompositionsForContrib as(Table alias) { + return new AdminGetLinkedCompositionsForContrib(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedCompositionsForContrib rename(String name) { + return new AdminGetLinkedCompositionsForContrib(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedCompositionsForContrib rename(Name name) { + return new AdminGetLinkedCompositionsForContrib(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedCompositionsForContrib rename(Table name) { + return new AdminGetLinkedCompositionsForContrib(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedCompositionsForContrib call(UUID contribIdInput) { + AdminGetLinkedCompositionsForContrib result = new AdminGetLinkedCompositionsForContrib( + DSL.name("admin_get_linked_compositions_for_contrib"), + null, + new Field[] {DSL.val(contribIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedCompositionsForContrib call(Field contribIdInput) { + AdminGetLinkedCompositionsForContrib result = new AdminGetLinkedCompositionsForContrib( + DSL.name("admin_get_linked_compositions_for_contrib"), null, new Field[] {contribIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedContributions.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedContributions.java new file mode 100644 index 0000000..6d90a5e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedContributions.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedContributionsRecord; +import org.jooq.Field; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedContributions extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_get_linked_contributions + */ + public static final AdminGetLinkedContributions ADMIN_GET_LINKED_CONTRIBUTIONS = new AdminGetLinkedContributions(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminGetLinkedContributionsRecord.class; + } + + /** + * The column ehr.admin_get_linked_contributions.contribution. + */ + public final TableField CONTRIBUTION = + createField(DSL.name("contribution"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.admin_get_linked_contributions.audit. + */ + public final TableField AUDIT = + createField(DSL.name("audit"), SQLDataType.UUID, this, ""); + + private AdminGetLinkedContributions(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminGetLinkedContributions( + Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_get_linked_contributions table + * reference + */ + public AdminGetLinkedContributions(String alias) { + this(DSL.name(alias), ADMIN_GET_LINKED_CONTRIBUTIONS); + } + + /** + * Create an aliased ehr.admin_get_linked_contributions table + * reference + */ + public AdminGetLinkedContributions(Name alias) { + this(alias, ADMIN_GET_LINKED_CONTRIBUTIONS); + } + + /** + * Create a ehr.admin_get_linked_contributions table reference + */ + public AdminGetLinkedContributions() { + this(DSL.name("admin_get_linked_contributions"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminGetLinkedContributions as(String alias) { + return new AdminGetLinkedContributions(DSL.name(alias), this, parameters); + } + + @Override + public AdminGetLinkedContributions as(Name alias) { + return new AdminGetLinkedContributions(alias, this, parameters); + } + + @Override + public AdminGetLinkedContributions as(Table alias) { + return new AdminGetLinkedContributions(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedContributions rename(String name) { + return new AdminGetLinkedContributions(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedContributions rename(Name name) { + return new AdminGetLinkedContributions(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedContributions rename(Table name) { + return new AdminGetLinkedContributions(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedContributions call(UUID ehrIdInput) { + AdminGetLinkedContributions result = new AdminGetLinkedContributions( + DSL.name("admin_get_linked_contributions"), null, new Field[] {DSL.val(ehrIdInput, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedContributions call(Field ehrIdInput) { + AdminGetLinkedContributions result = new AdminGetLinkedContributions( + DSL.name("admin_get_linked_contributions"), null, new Field[] {ehrIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedStatusForContrib.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedStatusForContrib.java new file mode 100644 index 0000000..2a1a930 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetLinkedStatusForContrib.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetLinkedStatusForContribRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedStatusForContrib extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of + * ehr.admin_get_linked_status_for_contrib + */ + public static final AdminGetLinkedStatusForContrib ADMIN_GET_LINKED_STATUS_FOR_CONTRIB = + new AdminGetLinkedStatusForContrib(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminGetLinkedStatusForContribRecord.class; + } + + /** + * The column ehr.admin_get_linked_status_for_contrib.status. + */ + public final TableField STATUS = + createField(DSL.name("status"), SQLDataType.UUID, this, ""); + + private AdminGetLinkedStatusForContrib(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private AdminGetLinkedStatusForContrib( + Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_get_linked_status_for_contrib + * table reference + */ + public AdminGetLinkedStatusForContrib(String alias) { + this(DSL.name(alias), ADMIN_GET_LINKED_STATUS_FOR_CONTRIB); + } + + /** + * Create an aliased ehr.admin_get_linked_status_for_contrib + * table reference + */ + public AdminGetLinkedStatusForContrib(Name alias) { + this(alias, ADMIN_GET_LINKED_STATUS_FOR_CONTRIB); + } + + /** + * Create a ehr.admin_get_linked_status_for_contrib table + * reference + */ + public AdminGetLinkedStatusForContrib() { + this(DSL.name("admin_get_linked_status_for_contrib"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminGetLinkedStatusForContrib as(String alias) { + return new AdminGetLinkedStatusForContrib(DSL.name(alias), this, parameters); + } + + @Override + public AdminGetLinkedStatusForContrib as(Name alias) { + return new AdminGetLinkedStatusForContrib(alias, this, parameters); + } + + @Override + public AdminGetLinkedStatusForContrib as(Table alias) { + return new AdminGetLinkedStatusForContrib(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedStatusForContrib rename(String name) { + return new AdminGetLinkedStatusForContrib(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedStatusForContrib rename(Name name) { + return new AdminGetLinkedStatusForContrib(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetLinkedStatusForContrib rename(Table name) { + return new AdminGetLinkedStatusForContrib(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedStatusForContrib call(UUID contribIdInput) { + AdminGetLinkedStatusForContrib result = + new AdminGetLinkedStatusForContrib(DSL.name("admin_get_linked_status_for_contrib"), null, new Field[] { + DSL.val(contribIdInput, SQLDataType.UUID) + }); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminGetLinkedStatusForContrib call(Field contribIdInput) { + AdminGetLinkedStatusForContrib result = new AdminGetLinkedStatusForContrib( + DSL.name("admin_get_linked_status_for_contrib"), null, new Field[] {contribIdInput}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetTemplateUsage.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetTemplateUsage.java new file mode 100644 index 0000000..b999b7e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AdminGetTemplateUsage.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AdminGetTemplateUsageRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetTemplateUsage extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.admin_get_template_usage + */ + public static final AdminGetTemplateUsage ADMIN_GET_TEMPLATE_USAGE = new AdminGetTemplateUsage(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminGetTemplateUsageRecord.class; + } + + /** + * The column ehr.admin_get_template_usage.composition_id. + */ + public final TableField COMPOSITION_ID = + createField(DSL.name("composition_id"), SQLDataType.UUID, this, ""); + + private AdminGetTemplateUsage(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.CLOB)}); + } + + private AdminGetTemplateUsage(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.admin_get_template_usage table + * reference + */ + public AdminGetTemplateUsage(String alias) { + this(DSL.name(alias), ADMIN_GET_TEMPLATE_USAGE); + } + + /** + * Create an aliased ehr.admin_get_template_usage table + * reference + */ + public AdminGetTemplateUsage(Name alias) { + this(alias, ADMIN_GET_TEMPLATE_USAGE); + } + + /** + * Create a ehr.admin_get_template_usage table reference + */ + public AdminGetTemplateUsage() { + this(DSL.name("admin_get_template_usage"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public AdminGetTemplateUsage as(String alias) { + return new AdminGetTemplateUsage(DSL.name(alias), this, parameters); + } + + @Override + public AdminGetTemplateUsage as(Name alias) { + return new AdminGetTemplateUsage(alias, this, parameters); + } + + @Override + public AdminGetTemplateUsage as(Table alias) { + return new AdminGetTemplateUsage(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetTemplateUsage rename(String name) { + return new AdminGetTemplateUsage(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetTemplateUsage rename(Name name) { + return new AdminGetTemplateUsage(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public AdminGetTemplateUsage rename(Table name) { + return new AdminGetTemplateUsage(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public AdminGetTemplateUsage call(String targetId) { + AdminGetTemplateUsage result = new AdminGetTemplateUsage( + DSL.name("admin_get_template_usage"), null, new Field[] {DSL.val(targetId, SQLDataType.CLOB)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public AdminGetTemplateUsage call(Field targetId) { + AdminGetTemplateUsage result = + new AdminGetTemplateUsage(DSL.name("admin_get_template_usage"), null, new Field[] {targetId}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Attestation.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Attestation.java new file mode 100644 index 0000000..031ee4d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Attestation.java @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AttestationRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function7; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row7; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Attestation extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.attestation + */ + public static final Attestation ATTESTATION = new Attestation(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AttestationRecord.class; + } + + /** + * The column ehr.attestation.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.attestation.proof. + */ + public final TableField PROOF = + createField(DSL.name("proof"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attestation.reason. + */ + public final TableField REASON = + createField(DSL.name("reason"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attestation.is_pending. + */ + public final TableField IS_PENDING = + createField(DSL.name("is_pending"), SQLDataType.BOOLEAN, this, ""); + + /** + * The column ehr.attestation.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.attestation.reference. + */ + public final TableField REFERENCE = + createField(DSL.name("reference"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.attestation.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Attestation(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Attestation(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.attestation table reference + */ + public Attestation(String alias) { + this(DSL.name(alias), ATTESTATION); + } + + /** + * Create an aliased ehr.attestation table reference + */ + public Attestation(Name alias) { + this(alias, ATTESTATION); + } + + /** + * Create a ehr.attestation table reference + */ + public Attestation() { + this(DSL.name("attestation"), null); + } + + public Attestation(Table child, ForeignKey key) { + super(child, key, ATTESTATION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTESTATION_REFERENCE_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTESTATION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.ATTESTATION__ATTESTATION_HAS_AUDIT_FKEY, + Keys.ATTESTATION__ATTESTATION_REFERENCE_FKEY, + Keys.ATTESTATION__ATTESTATION_SYS_TENANT_FKEY); + } + + private transient AuditDetails _auditDetails; + private transient AttestationRef _attestationRef; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) _auditDetails = new AuditDetails(this, Keys.ATTESTATION__ATTESTATION_HAS_AUDIT_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.attestation_ref table. + */ + public AttestationRef attestationRef() { + if (_attestationRef == null) + _attestationRef = new AttestationRef(this, Keys.ATTESTATION__ATTESTATION_REFERENCE_FKEY); + + return _attestationRef; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.ATTESTATION__ATTESTATION_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Attestation as(String alias) { + return new Attestation(DSL.name(alias), this); + } + + @Override + public Attestation as(Name alias) { + return new Attestation(alias, this); + } + + @Override + public Attestation as(Table alias) { + return new Attestation(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Attestation rename(String name) { + return new Attestation(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Attestation rename(Name name) { + return new Attestation(name, null); + } + + /** + * Rename this table + */ + @Override + public Attestation rename(Table name) { + return new Attestation(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function7< + ? super UUID, + ? super String, + ? super String, + ? super Boolean, + ? super UUID, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function7< + ? super UUID, + ? super String, + ? super String, + ? super Boolean, + ? super UUID, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestationRef.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestationRef.java new file mode 100644 index 0000000..e02af28 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestationRef.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AttestationRefRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AttestationRef extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.attestation_ref + */ + public static final AttestationRef ATTESTATION_REF = new AttestationRef(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AttestationRefRecord.class; + } + + /** + * The column ehr.attestation_ref.ref. + */ + public final TableField REF = createField( + DSL.name("ref"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.attestation_ref.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private AttestationRef(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AttestationRef(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.attestation_ref table reference + */ + public AttestationRef(String alias) { + this(DSL.name(alias), ATTESTATION_REF); + } + + /** + * Create an aliased ehr.attestation_ref table reference + */ + public AttestationRef(Name alias) { + this(alias, ATTESTATION_REF); + } + + /** + * Create a ehr.attestation_ref table reference + */ + public AttestationRef() { + this(DSL.name("attestation_ref"), null); + } + + public AttestationRef(Table child, ForeignKey key) { + super(child, key, ATTESTATION_REF); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTESTATION_REF_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.ATTESTATION_REF__ATTESTATION_REF_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.ATTESTATION_REF__ATTESTATION_REF_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public AttestationRef as(String alias) { + return new AttestationRef(DSL.name(alias), this); + } + + @Override + public AttestationRef as(Name alias) { + return new AttestationRef(alias, this); + } + + @Override + public AttestationRef as(Table alias) { + return new AttestationRef(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AttestationRef rename(String name) { + return new AttestationRef(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AttestationRef rename(Name name) { + return new AttestationRef(name, null); + } + + /** + * Rename this table + */ + @Override + public AttestationRef rename(Table name) { + return new AttestationRef(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestedView.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestedView.java new file mode 100644 index 0000000..3aba922 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AttestedView.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AttestedViewRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function11; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row11; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AttestedView extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.attested_view + */ + public static final AttestedView ATTESTED_VIEW = new AttestedView(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AttestedViewRecord.class; + } + + /** + * The column ehr.attested_view.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.attested_view.attestation_id. + */ + public final TableField ATTESTATION_ID = + createField(DSL.name("attestation_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.attested_view.alternate_text. + */ + public final TableField ALTERNATE_TEXT = + createField(DSL.name("alternate_text"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attested_view.compression_algorithm. + */ + public final TableField COMPRESSION_ALGORITHM = + createField(DSL.name("compression_algorithm"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attested_view.media_type. + */ + public final TableField MEDIA_TYPE = + createField(DSL.name("media_type"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attested_view.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.BLOB, this, ""); + + /** + * The column ehr.attested_view.integrity_check. + */ + public final TableField INTEGRITY_CHECK = + createField(DSL.name("integrity_check"), SQLDataType.BLOB, this, ""); + + /** + * The column ehr.attested_view.integrity_check_algorithm. + */ + public final TableField INTEGRITY_CHECK_ALGORITHM = + createField(DSL.name("integrity_check_algorithm"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attested_view.thumbnail. + */ + public final TableField THUMBNAIL = + createField(DSL.name("thumbnail"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.attested_view.uri. + */ + public final TableField URI = createField(DSL.name("uri"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.attested_view.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private AttestedView(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AttestedView(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.attested_view table reference + */ + public AttestedView(String alias) { + this(DSL.name(alias), ATTESTED_VIEW); + } + + /** + * Create an aliased ehr.attested_view table reference + */ + public AttestedView(Name alias) { + this(alias, ATTESTED_VIEW); + } + + /** + * Create a ehr.attested_view table reference + */ + public AttestedView() { + this(DSL.name("attested_view"), null); + } + + public AttestedView(Table child, ForeignKey key) { + super(child, key, ATTESTED_VIEW); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTESTED_VIEW_ATTESTATION_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTESTED_VIEW_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.ATTESTED_VIEW__ATTESTED_VIEW_ATTESTATION_ID_FKEY, + Keys.ATTESTED_VIEW__ATTESTED_VIEW_SYS_TENANT_FKEY); + } + + private transient Attestation _attestation; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.attestation table. + */ + public Attestation attestation() { + if (_attestation == null) + _attestation = new Attestation(this, Keys.ATTESTED_VIEW__ATTESTED_VIEW_ATTESTATION_ID_FKEY); + + return _attestation; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.ATTESTED_VIEW__ATTESTED_VIEW_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public AttestedView as(String alias) { + return new AttestedView(DSL.name(alias), this); + } + + @Override + public AttestedView as(Name alias) { + return new AttestedView(alias, this); + } + + @Override + public AttestedView as(Table alias) { + return new AttestedView(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AttestedView rename(String name) { + return new AttestedView(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AttestedView rename(Name name) { + return new AttestedView(name, null); + } + + /** + * Rename this table + */ + @Override + public AttestedView rename(Table name) { + return new AttestedView(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function11< + ? super UUID, + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super byte[], + ? super byte[], + ? super String, + ? super UUID, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function11< + ? super UUID, + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super byte[], + ? super byte[], + ? super String, + ? super UUID, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AuditDetails.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AuditDetails.java new file mode 100644 index 0000000..ae6a456 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/AuditDetails.java @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionChangeType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.AuditDetailsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function8; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row8; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AuditDetails extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.audit_details + */ + public static final AuditDetails AUDIT_DETAILS = new AuditDetails(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AuditDetailsRecord.class; + } + + /** + * The column ehr.audit_details.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.audit_details.system_id. + */ + public final TableField SYSTEM_ID = + createField(DSL.name("system_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.audit_details.committer. + */ + public final TableField COMMITTER = + createField(DSL.name("committer"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.audit_details.time_committed. + */ + public final TableField TIME_COMMITTED = createField( + DSL.name("time_committed"), + SQLDataType.TIMESTAMP(6).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), + this, + ""); + + /** + * The column ehr.audit_details.time_committed_tzid. + */ + public final TableField TIME_COMMITTED_TZID = + createField(DSL.name("time_committed_tzid"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.audit_details.change_type. + */ + public final TableField CHANGE_TYPE = createField( + DSL.name("change_type"), + SQLDataType.VARCHAR + .nullable(false) + .asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionChangeType.class), + this, + ""); + + /** + * The column ehr.audit_details.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.audit_details.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private AuditDetails(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AuditDetails(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.audit_details table reference + */ + public AuditDetails(String alias) { + this(DSL.name(alias), AUDIT_DETAILS); + } + + /** + * Create an aliased ehr.audit_details table reference + */ + public AuditDetails(Name alias) { + this(alias, AUDIT_DETAILS); + } + + /** + * Create a ehr.audit_details table reference + */ + public AuditDetails() { + this(DSL.name("audit_details"), null); + } + + public AuditDetails(Table child, ForeignKey key) { + super(child, key, AUDIT_DETAILS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.AUDIT_DETAILS_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.AUDIT_DETAILS__AUDIT_DETAILS_SYSTEM_ID_FKEY, + Keys.AUDIT_DETAILS__AUDIT_DETAILS_COMMITTER_FKEY, + Keys.AUDIT_DETAILS__AUDIT_DETAILS_SYS_TENANT_FKEY); + } + + private transient System _system; + private transient PartyIdentified _partyIdentified; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.system table. + */ + public System system() { + if (_system == null) _system = new System(this, Keys.AUDIT_DETAILS__AUDIT_DETAILS_SYSTEM_ID_FKEY); + + return _system; + } + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) + _partyIdentified = new PartyIdentified(this, Keys.AUDIT_DETAILS__AUDIT_DETAILS_COMMITTER_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.AUDIT_DETAILS__AUDIT_DETAILS_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public AuditDetails as(String alias) { + return new AuditDetails(DSL.name(alias), this); + } + + @Override + public AuditDetails as(Name alias) { + return new AuditDetails(alias, this); + } + + @Override + public AuditDetails as(Table alias) { + return new AuditDetails(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AuditDetails rename(String name) { + return new AuditDetails(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AuditDetails rename(Name name) { + return new AuditDetails(name, null); + } + + /** + * Rename this table + */ + @Override + public AuditDetails rename(Table name) { + return new AuditDetails(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function8< + ? super UUID, + ? super UUID, + ? super UUID, + ? super Timestamp, + ? super String, + ? super ContributionChangeType, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function8< + ? super UUID, + ? super UUID, + ? super UUID, + ? super Timestamp, + ? super String, + ? super ContributionChangeType, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompExpand.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompExpand.java new file mode 100644 index 0000000..76a7a1e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompExpand.java @@ -0,0 +1,332 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompExpandRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompExpand extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.comp_expand + */ + public static final CompExpand COMP_EXPAND = new CompExpand(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompExpandRecord.class; + } + + /** + * The column ehr.comp_expand.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.comp_expand.subject_externalref_id_value. + */ + public final TableField SUBJECT_EXTERNALREF_ID_VALUE = + createField(DSL.name("subject_externalref_id_value"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.subject_externalref_id_namespace. + */ + public final TableField SUBJECT_EXTERNALREF_ID_NAMESPACE = + createField(DSL.name("subject_externalref_id_namespace"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.composition_id. + */ + public final TableField COMPOSITION_ID = + createField(DSL.name("composition_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.comp_expand.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.archetype_id. + */ + public final TableField ARCHETYPE_ID = + createField(DSL.name("archetype_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.entry. + */ + public final TableField ENTRY = + createField(DSL.name("entry"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.comp_expand.composition_name. + */ + public final TableField COMPOSITION_NAME = + createField(DSL.name("composition_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.language. + */ + public final TableField LANGUAGE = + createField(DSL.name("language"), SQLDataType.VARCHAR(5), this, ""); + + /** + * The column ehr.comp_expand.territory. + */ + public final TableField TERRITORY = + createField(DSL.name("territory"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.comp_expand.start_time. + */ + public final TableField START_TIME = + createField(DSL.name("start_time"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.comp_expand.start_time_tzid. + */ + public final TableField START_TIME_TZID = + createField(DSL.name("start_time_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.end_time. + */ + public final TableField END_TIME = + createField(DSL.name("end_time"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.comp_expand.end_time_tzid. + */ + public final TableField END_TIME_TZID = + createField(DSL.name("end_time_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.other_context. + */ + public final TableField OTHER_CONTEXT = + createField(DSL.name("other_context"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.comp_expand.ctx_location. + */ + public final TableField CTX_LOCATION = + createField(DSL.name("ctx_location"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.facility_name. + */ + public final TableField FACILITY_NAME = + createField(DSL.name("facility_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.facility_ref. + */ + public final TableField FACILITY_REF = + createField(DSL.name("facility_ref"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.facility_scheme. + */ + public final TableField FACILITY_SCHEME = + createField(DSL.name("facility_scheme"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.facility_namespace. + */ + public final TableField FACILITY_NAMESPACE = + createField(DSL.name("facility_namespace"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.facility_type. + */ + public final TableField FACILITY_TYPE = + createField(DSL.name("facility_type"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.composer_name. + */ + public final TableField COMPOSER_NAME = + createField(DSL.name("composer_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.composer_ref. + */ + public final TableField COMPOSER_REF = + createField(DSL.name("composer_ref"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.composer_scheme. + */ + public final TableField COMPOSER_SCHEME = + createField(DSL.name("composer_scheme"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.composer_namespace. + */ + public final TableField COMPOSER_NAMESPACE = + createField(DSL.name("composer_namespace"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_expand.composer_type. + */ + public final TableField COMPOSER_TYPE = + createField(DSL.name("composer_type"), SQLDataType.CLOB, this, ""); + + private CompExpand(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompExpand(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment(""), + TableOptions.view( + """ + create view "comp_expand" as SELECT ehr.id AS ehr_id, + party.party_ref_value AS subject_externalref_id_value, + party.party_ref_namespace AS subject_externalref_id_namespace, + entry.composition_id, + entry.template_id, + entry.archetype_id, + entry.entry, + ltrim(rtrim((regexp_split_to_array(json_object_keys((entry.entry)::json), 'and name/value='::text))[2], ''']'::text), ''''::text) AS composition_name, + compo.language, + compo.territory, + ctx.start_time, + ctx.start_time_tzid, + ctx.end_time, + ctx.end_time_tzid, + ctx.other_context, + ctx.location AS ctx_location, + fclty.name AS facility_name, + fclty.party_ref_value AS facility_ref, + fclty.party_ref_scheme AS facility_scheme, + fclty.party_ref_namespace AS facility_namespace, + fclty.party_ref_type AS facility_type, + compr.name AS composer_name, + compr.party_ref_value AS composer_ref, + compr.party_ref_scheme AS composer_scheme, + compr.party_ref_namespace AS composer_namespace, + compr.party_ref_type AS composer_type + FROM (((((((ehr.entry + JOIN ehr.composition compo ON ((compo.id = entry.composition_id))) + JOIN ehr.event_context ctx ON ((ctx.composition_id = entry.composition_id))) + JOIN ehr.party_identified compr ON ((compo.composer = compr.id))) + JOIN ehr.ehr ehr ON ((ehr.id = compo.ehr_id))) + JOIN ehr.status status ON ((status.ehr_id = ehr.id))) + LEFT JOIN ehr.party_identified party ON ((status.party = party.id))) + LEFT JOIN ehr.party_identified fclty ON ((ctx.facility = fclty.id))); + """)); + } + + /** + * Create an aliased ehr.comp_expand table reference + */ + public CompExpand(String alias) { + this(DSL.name(alias), COMP_EXPAND); + } + + /** + * Create an aliased ehr.comp_expand table reference + */ + public CompExpand(Name alias) { + this(alias, COMP_EXPAND); + } + + /** + * Create a ehr.comp_expand table reference + */ + public CompExpand() { + this(DSL.name("comp_expand"), null); + } + + public CompExpand(Table child, ForeignKey key) { + super(child, key, COMP_EXPAND); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public CompExpand as(String alias) { + return new CompExpand(DSL.name(alias), this); + } + + @Override + public CompExpand as(Name alias) { + return new CompExpand(alias, this); + } + + @Override + public CompExpand as(Table alias) { + return new CompExpand(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompExpand rename(String name) { + return new CompExpand(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompExpand rename(Name name) { + return new CompExpand(name, null); + } + + /** + * Rename this table + */ + @Override + public CompExpand rename(Table name) { + return new CompExpand(name.getQualifiedName(), null); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompoXref.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompoXref.java new file mode 100644 index 0000000..0c7500b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompoXref.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompoXrefRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompoXref extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.compo_xref + */ + public static final CompoXref COMPO_XREF = new CompoXref(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompoXrefRecord.class; + } + + /** + * The column ehr.compo_xref.master_uuid. + */ + public final TableField MASTER_UUID = + createField(DSL.name("master_uuid"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.compo_xref.child_uuid. + */ + public final TableField CHILD_UUID = + createField(DSL.name("child_uuid"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.compo_xref.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.compo_xref.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private CompoXref(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompoXref(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.compo_xref table reference + */ + public CompoXref(String alias) { + this(DSL.name(alias), COMPO_XREF); + } + + /** + * Create an aliased ehr.compo_xref table reference + */ + public CompoXref(Name alias) { + this(alias, COMPO_XREF); + } + + /** + * Create a ehr.compo_xref table reference + */ + public CompoXref() { + this(DSL.name("compo_xref"), null); + } + + public CompoXref(Table child, ForeignKey key) { + super(child, key, COMPO_XREF); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.COMPO_XREF_CHILD_IDX, Indexes.EHR_COMPO_XREF); + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.COMPO_XREF__COMPO_XREF_MASTER_UUID_FKEY, + Keys.COMPO_XREF__COMPO_XREF_CHILD_UUID_FKEY, + Keys.COMPO_XREF__COMPO_XREF_SYS_TENANT_FKEY); + } + + private transient Composition _compoXrefMasterUuidFkey; + private transient Composition _compoXrefChildUuidFkey; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.composition table, via + * the compo_xref_master_uuid_fkey key. + */ + public Composition compoXrefMasterUuidFkey() { + if (_compoXrefMasterUuidFkey == null) + _compoXrefMasterUuidFkey = new Composition(this, Keys.COMPO_XREF__COMPO_XREF_MASTER_UUID_FKEY); + + return _compoXrefMasterUuidFkey; + } + + /** + * Get the implicit join path to the ehr.composition table, via + * the compo_xref_child_uuid_fkey key. + */ + public Composition compoXrefChildUuidFkey() { + if (_compoXrefChildUuidFkey == null) + _compoXrefChildUuidFkey = new Composition(this, Keys.COMPO_XREF__COMPO_XREF_CHILD_UUID_FKEY); + + return _compoXrefChildUuidFkey; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.COMPO_XREF__COMPO_XREF_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public CompoXref as(String alias) { + return new CompoXref(DSL.name(alias), this); + } + + @Override + public CompoXref as(Name alias) { + return new CompoXref(alias, this); + } + + @Override + public CompoXref as(Table alias) { + return new CompoXref(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompoXref rename(String name) { + return new CompoXref(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompoXref rename(Name name) { + return new CompoXref(name, null); + } + + /** + * Rename this table + */ + @Override + public CompoXref rename(Table name) { + return new CompoXref(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Composition.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Composition.java new file mode 100644 index 0000000..518523c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Composition.java @@ -0,0 +1,442 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompositionRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function15; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row15; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * Composition table + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Composition extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.composition + */ + public static final Composition COMPOSITION = new Composition(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompositionRecord.class; + } + + /** + * The column ehr.composition.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.composition.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition.in_contribution. + */ + public final TableField IN_CONTRIBUTION = + createField(DSL.name("in_contribution"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition.active. + */ + public final TableField ACTIVE = createField( + DSL.name("active"), + SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), + this, + ""); + + /** + * The column ehr.composition.is_persistent. + */ + public final TableField IS_PERSISTENT = createField( + DSL.name("is_persistent"), + SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), + this, + ""); + + /** + * The column ehr.composition.language. + */ + public final TableField LANGUAGE = + createField(DSL.name("language"), SQLDataType.VARCHAR(5), this, ""); + + /** + * The column ehr.composition.territory. + */ + public final TableField TERRITORY = + createField(DSL.name("territory"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.composition.composer. + */ + public final TableField COMPOSER = + createField(DSL.name("composer"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.composition.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.composition.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.composition.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition.attestation_ref. + */ + public final TableField ATTESTATION_REF = + createField(DSL.name("attestation_ref"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition.feeder_audit. + */ + public final TableField FEEDER_AUDIT = + createField(DSL.name("feeder_audit"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.composition.links. + */ + public final TableField LINKS = + createField(DSL.name("links"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.composition.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Composition(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Composition(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("Composition table"), TableOptions.table()); + } + + /** + * Create an aliased ehr.composition table reference + */ + public Composition(String alias) { + this(DSL.name(alias), COMPOSITION); + } + + /** + * Create an aliased ehr.composition table reference + */ + public Composition(Name alias) { + this(alias, COMPOSITION); + } + + /** + * Create a ehr.composition table reference + */ + public Composition() { + this(DSL.name("composition"), null); + } + + public Composition(Table child, ForeignKey key) { + super(child, key, COMPOSITION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.COMPOSITION_COMPOSER_IDX, Indexes.COMPOSITION_EHR_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.COMPOSITION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.COMPOSITION__COMPOSITION_EHR_ID_FKEY, + Keys.COMPOSITION__COMPOSITION_IN_CONTRIBUTION_FKEY, + Keys.COMPOSITION__COMPOSITION_LANGUAGE_FKEY, + Keys.COMPOSITION__COMPOSITION_TERRITORY_FKEY, + Keys.COMPOSITION__COMPOSITION_COMPOSER_FKEY, + Keys.COMPOSITION__COMPOSITION_HAS_AUDIT_FKEY, + Keys.COMPOSITION__COMPOSITION_ATTESTATION_REF_FKEY, + Keys.COMPOSITION__COMPOSITION_SYS_TENANT_FKEY); + } + + private transient org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient Language _language; + private transient Territory _territory; + private transient PartyIdentified _partyIdentified; + private transient AuditDetails _auditDetails; + private transient AttestationRef _attestationRef; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr( + this, Keys.COMPOSITION__COMPOSITION_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution(this, Keys.COMPOSITION__COMPOSITION_IN_CONTRIBUTION_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.language table. + */ + public Language language() { + if (_language == null) _language = new Language(this, Keys.COMPOSITION__COMPOSITION_LANGUAGE_FKEY); + + return _language; + } + + /** + * Get the implicit join path to the ehr.territory table. + */ + public Territory territory() { + if (_territory == null) _territory = new Territory(this, Keys.COMPOSITION__COMPOSITION_TERRITORY_FKEY); + + return _territory; + } + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) + _partyIdentified = new PartyIdentified(this, Keys.COMPOSITION__COMPOSITION_COMPOSER_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) _auditDetails = new AuditDetails(this, Keys.COMPOSITION__COMPOSITION_HAS_AUDIT_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.attestation_ref table. + */ + public AttestationRef attestationRef() { + if (_attestationRef == null) + _attestationRef = new AttestationRef(this, Keys.COMPOSITION__COMPOSITION_ATTESTATION_REF_FKEY); + + return _attestationRef; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.COMPOSITION__COMPOSITION_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Composition as(String alias) { + return new Composition(DSL.name(alias), this); + } + + @Override + public Composition as(Name alias) { + return new Composition(alias, this); + } + + @Override + public Composition as(Table alias) { + return new Composition(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Composition rename(String name) { + return new Composition(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Composition rename(Name name) { + return new Composition(name, null); + } + + /** + * Rename this table + */ + @Override + public Composition rename(Table name) { + return new Composition(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function15< + ? super UUID, + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super String, + ? super Integer, + ? super UUID, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super JSONB, + ? super JSONB, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function15< + ? super UUID, + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super String, + ? super Integer, + ? super UUID, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super JSONB, + ? super JSONB, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompositionHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompositionHistory.java new file mode 100644 index 0000000..a627d98 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/CompositionHistory.java @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.CompositionHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function15; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row15; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompositionHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.composition_history + */ + public static final CompositionHistory COMPOSITION_HISTORY = new CompositionHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompositionHistoryRecord.class; + } + + /** + * The column ehr.composition_history.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.composition_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition_history.in_contribution. + */ + public final TableField IN_CONTRIBUTION = + createField(DSL.name("in_contribution"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition_history.active. + */ + public final TableField ACTIVE = + createField(DSL.name("active"), SQLDataType.BOOLEAN, this, ""); + + /** + * The column ehr.composition_history.is_persistent. + */ + public final TableField IS_PERSISTENT = + createField(DSL.name("is_persistent"), SQLDataType.BOOLEAN, this, ""); + + /** + * The column ehr.composition_history.language. + */ + public final TableField LANGUAGE = + createField(DSL.name("language"), SQLDataType.VARCHAR(5), this, ""); + + /** + * The column ehr.composition_history.territory. + */ + public final TableField TERRITORY = + createField(DSL.name("territory"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.composition_history.composer. + */ + public final TableField COMPOSER = + createField(DSL.name("composer"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.composition_history.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.composition_history.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.composition_history.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition_history.attestation_ref. + */ + public final TableField ATTESTATION_REF = + createField(DSL.name("attestation_ref"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.composition_history.feeder_audit. + */ + public final TableField FEEDER_AUDIT = + createField(DSL.name("feeder_audit"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.composition_history.links. + */ + public final TableField LINKS = + createField(DSL.name("links"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.composition_history.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private CompositionHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompositionHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.composition_history table reference + */ + public CompositionHistory(String alias) { + this(DSL.name(alias), COMPOSITION_HISTORY); + } + + /** + * Create an aliased ehr.composition_history table reference + */ + public CompositionHistory(Name alias) { + this(alias, COMPOSITION_HISTORY); + } + + /** + * Create a ehr.composition_history table reference + */ + public CompositionHistory() { + this(DSL.name("composition_history"), null); + } + + public CompositionHistory(Table child, ForeignKey key) { + super(child, key, COMPOSITION_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.COMPOSITION_HISTORY_EHR_IDX, Indexes.EHR_COMPOSITION_HISTORY); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.COMPOSITION_HISTORY__COMPOSITION_HISTORY_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.COMPOSITION_HISTORY__COMPOSITION_HISTORY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public CompositionHistory as(String alias) { + return new CompositionHistory(DSL.name(alias), this); + } + + @Override + public CompositionHistory as(Name alias) { + return new CompositionHistory(alias, this); + } + + @Override + public CompositionHistory as(Table alias) { + return new CompositionHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompositionHistory rename(String name) { + return new CompositionHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompositionHistory rename(Name name) { + return new CompositionHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public CompositionHistory rename(Table name) { + return new CompositionHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function15< + ? super UUID, + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super String, + ? super Integer, + ? super UUID, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super JSONB, + ? super JSONB, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function15< + ? super UUID, + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super String, + ? super Integer, + ? super UUID, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super JSONB, + ? super JSONB, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Concept.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Concept.java new file mode 100644 index 0000000..3817a6b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Concept.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ConceptRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * openEHR common concepts (e.g. terminology) used in the system + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Concept extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.concept + */ + public static final Concept CONCEPT = new Concept(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ConceptRecord.class; + } + + /** + * The column ehr.concept.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.concept.conceptid. + */ + public final TableField CONCEPTID = + createField(DSL.name("conceptid"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.concept.language. + */ + public final TableField LANGUAGE = + createField(DSL.name("language"), SQLDataType.VARCHAR(5), this, ""); + + /** + * The column ehr.concept.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.CLOB, this, ""); + + private Concept(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Concept(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("openEHR common concepts (e.g. terminology) used in the system"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.concept table reference + */ + public Concept(String alias) { + this(DSL.name(alias), CONCEPT); + } + + /** + * Create an aliased ehr.concept table reference + */ + public Concept(Name alias) { + this(alias, CONCEPT); + } + + /** + * Create a ehr.concept table reference + */ + public Concept() { + this(DSL.name("concept"), null); + } + + public Concept(Table child, ForeignKey key) { + super(child, key, CONCEPT); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_CONCEPT_ID_LANGUAGE_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONCEPT_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.CONCEPT__CONCEPT_LANGUAGE_FKEY); + } + + private transient Language _language; + + /** + * Get the implicit join path to the ehr.language table. + */ + public Language language() { + if (_language == null) _language = new Language(this, Keys.CONCEPT__CONCEPT_LANGUAGE_FKEY); + + return _language; + } + + @Override + public Concept as(String alias) { + return new Concept(DSL.name(alias), this); + } + + @Override + public Concept as(Name alias) { + return new Concept(alias, this); + } + + @Override + public Concept as(Table alias) { + return new Concept(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Concept rename(String name) { + return new Concept(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Concept rename(Name name) { + return new Concept(name, null); + } + + /** + * Rename this table + */ + @Override + public Concept rename(Table name) { + return new Concept(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Contribution.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Contribution.java new file mode 100644 index 0000000..0ac6232 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Contribution.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionDataType; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionState; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ContributionRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function7; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row7; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * Contribution table, compositions reference this table + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Contribution extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.contribution + */ + public static final Contribution CONTRIBUTION = new Contribution(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ContributionRecord.class; + } + + /** + * The column ehr.contribution.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.contribution.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.contribution.contribution_type. + */ + public final TableField CONTRIBUTION_TYPE = createField( + DSL.name("contribution_type"), + SQLDataType.VARCHAR.asEnumDataType( + org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionDataType.class), + this, + ""); + + /** + * The column ehr.contribution.state. + */ + public final TableField STATE = createField( + DSL.name("state"), + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionState.class), + this, + ""); + + /** + * The column ehr.contribution.signature. + */ + public final TableField SIGNATURE = + createField(DSL.name("signature"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.contribution.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.contribution.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Contribution(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Contribution(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("Contribution table, compositions reference this table"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.contribution table reference + */ + public Contribution(String alias) { + this(DSL.name(alias), CONTRIBUTION); + } + + /** + * Create an aliased ehr.contribution table reference + */ + public Contribution(Name alias) { + this(alias, CONTRIBUTION); + } + + /** + * Create a ehr.contribution table reference + */ + public Contribution() { + this(DSL.name("contribution"), null); + } + + public Contribution(Table child, ForeignKey key) { + super(child, key, CONTRIBUTION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CONTRIBUTION_EHR_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONTRIBUTION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.CONTRIBUTION__CONTRIBUTION_EHR_ID_FKEY, + Keys.CONTRIBUTION__CONTRIBUTION_HAS_AUDIT_FKEY, + Keys.CONTRIBUTION__CONTRIBUTION_SYS_TENANT_FKEY); + } + + private transient org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr _ehr; + private transient AuditDetails _auditDetails; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr( + this, Keys.CONTRIBUTION__CONTRIBUTION_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.CONTRIBUTION__CONTRIBUTION_HAS_AUDIT_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.CONTRIBUTION__CONTRIBUTION_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Contribution as(String alias) { + return new Contribution(DSL.name(alias), this); + } + + @Override + public Contribution as(Name alias) { + return new Contribution(alias, this); + } + + @Override + public Contribution as(Table alias) { + return new Contribution(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Contribution rename(String name) { + return new Contribution(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Contribution rename(Name name) { + return new Contribution(name, null); + } + + /** + * Rename this table + */ + @Override + public Contribution rename(Table name) { + return new Contribution(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function7< + ? super UUID, + ? super UUID, + ? super ContributionDataType, + ? super ContributionState, + ? super String, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function7< + ? super UUID, + ? super UUID, + ? super ContributionDataType, + ? super ContributionState, + ? super String, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Ehr.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Ehr.java new file mode 100644 index 0000000..e139ff8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Ehr.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function6; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * EHR itself + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Ehr extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr + */ + public static final Ehr EHR_ = new Ehr(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrRecord.class; + } + + /** + * The column ehr.ehr.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.ehr.date_created. + */ + public final TableField DATE_CREATED = createField( + DSL.name("date_created"), + SQLDataType.TIMESTAMP(6).defaultValue(DSL.field(DSL.raw("CURRENT_DATE"), SQLDataType.TIMESTAMP)), + this, + ""); + + /** + * The column ehr.ehr.date_created_tzid. + */ + public final TableField DATE_CREATED_TZID = + createField(DSL.name("date_created_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr.access. + */ + public final TableField ACCESS = createField(DSL.name("access"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.ehr.system_id. + */ + public final TableField SYSTEM_ID = createField(DSL.name("system_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.ehr.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Ehr(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Ehr(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("EHR itself"), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr table reference + */ + public Ehr(String alias) { + this(DSL.name(alias), EHR_); + } + + /** + * Create an aliased ehr.ehr table reference + */ + public Ehr(Name alias) { + this(alias, EHR_); + } + + /** + * Create a ehr.ehr table reference + */ + public Ehr() { + this(DSL.name("ehr"), null); + } + + public Ehr(Table child, ForeignKey key) { + super(child, key, EHR_); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.exporter.v0.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.EHR__EHR_ACCESS_FKEY, Keys.EHR__EHR_SYSTEM_ID_FKEY, Keys.EHR__EHR_SYS_TENANT_FKEY); + } + + private transient Access _access; + private transient System _system; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.access table. + */ + public Access access() { + if (_access == null) _access = new Access(this, Keys.EHR__EHR_ACCESS_FKEY); + + return _access; + } + + /** + * Get the implicit join path to the ehr.system table. + */ + public System system() { + if (_system == null) _system = new System(this, Keys.EHR__EHR_SYSTEM_ID_FKEY); + + return _system; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.EHR__EHR_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Ehr as(String alias) { + return new Ehr(DSL.name(alias), this); + } + + @Override + public Ehr as(Name alias) { + return new Ehr(alias, this); + } + + @Override + public Ehr as(Table alias) { + return new Ehr(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Ehr rename(String name) { + return new Ehr(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Ehr rename(Name name) { + return new Ehr(name, null); + } + + /** + * Rename this table + */ + @Override + public Ehr rename(Table name) { + return new Ehr(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function6< + ? super UUID, + ? super Timestamp, + ? super String, + ? super UUID, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function6< + ? super UUID, + ? super Timestamp, + ? super String, + ? super UUID, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolder.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolder.java new file mode 100644 index 0000000..dd2ced9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolder.java @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrFolderRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function16; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row16; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrFolder extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_folder + */ + public static final EhrFolder EHR_FOLDER = new EhrFolder(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrFolderRecord.class; + } + + /** + * The column ehr.ehr_folder.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.ehr_folders_idx. + */ + public final TableField EHR_FOLDERS_IDX = + createField(DSL.name("ehr_folders_idx"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.row_num. + */ + public final TableField ROW_NUM = + createField(DSL.name("row_num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.archetype_node_id. + */ + public final TableField ARCHETYPE_NODE_ID = + createField(DSL.name("archetype_node_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder.path. + */ + public final TableField PATH = + createField(DSL.name("path"), SQLDataType.CLOB.array(), this, ""); + + /** + * The column ehr.ehr_folder.hierarchy_idx. + */ + public final TableField HIERARCHY_IDX = + createField(DSL.name("hierarchy_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.hierarchy_idx_cap. + */ + public final TableField HIERARCHY_IDX_CAP = + createField(DSL.name("hierarchy_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.hierarchy_idx_len. + */ + public final TableField HIERARCHY_IDX_LEN = + createField(DSL.name("hierarchy_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.items. + */ + public final TableField ITEMS = + createField(DSL.name("items"), SQLDataType.UUID.array(), this, ""); + + /** + * The column ehr.ehr_folder.fields. + */ + public final TableField FIELDS = + createField(DSL.name("fields"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.ehr_folder.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.ehr_folder.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private EhrFolder(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrFolder(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_folder table reference + */ + public EhrFolder(String alias) { + this(DSL.name(alias), EHR_FOLDER); + } + + /** + * Create an aliased ehr.ehr_folder table reference + */ + public EhrFolder(Name alias) { + this(alias, EHR_FOLDER); + } + + /** + * Create a ehr.ehr_folder table reference + */ + public EhrFolder() { + this(DSL.name("ehr_folder"), null); + } + + public EhrFolder(Table child, ForeignKey key) { + super(child, key, EHR_FOLDER); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_FOLDER_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_FOLDER__EHR_FOLDER_EHR_ID_FKEY, + Keys.EHR_FOLDER__EHR_FOLDER_CONTRIBUTION_ID_FKEY, + Keys.EHR_FOLDER__EHR_FOLDER_AUDIT_ID_FKEY, + Keys.EHR_FOLDER__EHR_FOLDER_SYS_TENANT_FKEY); + } + + private transient org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr( + this, Keys.EHR_FOLDER__EHR_FOLDER_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution(this, Keys.EHR_FOLDER__EHR_FOLDER_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) _auditDetails = new AuditDetails(this, Keys.EHR_FOLDER__EHR_FOLDER_AUDIT_ID_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.EHR_FOLDER__EHR_FOLDER_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public EhrFolder as(String alias) { + return new EhrFolder(DSL.name(alias), this); + } + + @Override + public EhrFolder as(Name alias) { + return new EhrFolder(alias, this); + } + + @Override + public EhrFolder as(Table alias) { + return new EhrFolder(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrFolder rename(String name) { + return new EhrFolder(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrFolder rename(Name name) { + return new EhrFolder(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrFolder rename(Table name) { + return new EhrFolder(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row16 type methods + // ------------------------------------------------------------------------- + + @Override + public Row16< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + Short> + fieldsRow() { + return (Row16) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function16< + ? super UUID, + ? super UUID, + ? super Integer, + ? super Integer, + ? super UUID, + ? super UUID, + ? super String, + ? super String[], + ? super String, + ? super String, + ? super Integer, + ? super UUID[], + ? super JSONB, + ? super Integer, + ? super OffsetDateTime, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function16< + ? super UUID, + ? super UUID, + ? super Integer, + ? super Integer, + ? super UUID, + ? super UUID, + ? super String, + ? super String[], + ? super String, + ? super String, + ? super Integer, + ? super UUID[], + ? super JSONB, + ? super Integer, + ? super OffsetDateTime, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolderHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolderHistory.java new file mode 100644 index 0000000..7ed8c91 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrFolderHistory.java @@ -0,0 +1,399 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrFolderHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function18; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row18; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrFolderHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_folder_history + */ + public static final EhrFolderHistory EHR_FOLDER_HISTORY = new EhrFolderHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrFolderHistoryRecord.class; + } + + /** + * The column ehr.ehr_folder_history.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.ehr_folders_idx. + */ + public final TableField EHR_FOLDERS_IDX = + createField(DSL.name("ehr_folders_idx"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.row_num. + */ + public final TableField ROW_NUM = + createField(DSL.name("row_num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.archetype_node_id. + */ + public final TableField ARCHETYPE_NODE_ID = + createField(DSL.name("archetype_node_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_history.path. + */ + public final TableField PATH = + createField(DSL.name("path"), SQLDataType.CLOB.array(), this, ""); + + /** + * The column ehr.ehr_folder_history.hierarchy_idx. + */ + public final TableField HIERARCHY_IDX = + createField(DSL.name("hierarchy_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.hierarchy_idx_cap. + */ + public final TableField HIERARCHY_IDX_CAP = + createField(DSL.name("hierarchy_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.hierarchy_idx_len. + */ + public final TableField HIERARCHY_IDX_LEN = + createField(DSL.name("hierarchy_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.items. + */ + public final TableField ITEMS = + createField(DSL.name("items"), SQLDataType.UUID.array(), this, ""); + + /** + * The column ehr.ehr_folder_history.fields. + */ + public final TableField FIELDS = + createField(DSL.name("fields"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.ehr_folder_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.sys_period_upper. + */ + public final TableField SYS_PERIOD_UPPER = + createField(DSL.name("sys_period_upper"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); + + /** + * The column ehr.ehr_folder_history.sys_deleted. + */ + public final TableField SYS_DELETED = + createField(DSL.name("sys_deleted"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_history.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private EhrFolderHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrFolderHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_folder_history table reference + */ + public EhrFolderHistory(String alias) { + this(DSL.name(alias), EHR_FOLDER_HISTORY); + } + + /** + * Create an aliased ehr.ehr_folder_history table reference + */ + public EhrFolderHistory(Name alias) { + this(alias, EHR_FOLDER_HISTORY); + } + + /** + * Create a ehr.ehr_folder_history table reference + */ + public EhrFolderHistory() { + this(DSL.name("ehr_folder_history"), null); + } + + public EhrFolderHistory(Table child, ForeignKey key) { + super(child, key, EHR_FOLDER_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_FOLDER_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_EHR_ID_FKEY, + Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_CONTRIBUTION_ID_FKEY, + Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_AUDIT_ID_FKEY, + Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_SYS_TENANT_FKEY); + } + + private transient org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr( + this, Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution(this, Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_AUDIT_ID_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.EHR_FOLDER_HISTORY__EHR_FOLDER_HISTORY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public EhrFolderHistory as(String alias) { + return new EhrFolderHistory(DSL.name(alias), this); + } + + @Override + public EhrFolderHistory as(Name alias) { + return new EhrFolderHistory(alias, this); + } + + @Override + public EhrFolderHistory as(Table alias) { + return new EhrFolderHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrFolderHistory rename(String name) { + return new EhrFolderHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderHistory rename(Name name) { + return new EhrFolderHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderHistory rename(Table name) { + return new EhrFolderHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row18 type methods + // ------------------------------------------------------------------------- + + @Override + public Row18< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + OffsetDateTime, + Boolean, + Short> + fieldsRow() { + return (Row18) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function18< + ? super UUID, + ? super UUID, + ? super Integer, + ? super Integer, + ? super UUID, + ? super UUID, + ? super String, + ? super String[], + ? super String, + ? super String, + ? super Integer, + ? super UUID[], + ? super JSONB, + ? super Integer, + ? super OffsetDateTime, + ? super OffsetDateTime, + ? super Boolean, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function18< + ? super UUID, + ? super UUID, + ? super Integer, + ? super Integer, + ? super UUID, + ? super UUID, + ? super String, + ? super String[], + ? super String, + ? super String, + ? super Integer, + ? super UUID[], + ? super JSONB, + ? super Integer, + ? super OffsetDateTime, + ? super OffsetDateTime, + ? super Boolean, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrStatus.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrStatus.java new file mode 100644 index 0000000..0482d25 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EhrStatus.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EhrStatusRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function11; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row11; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrStatus extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_status + */ + public static final EhrStatus EHR_STATUS = new EhrStatus(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrStatusRecord.class; + } + + /** + * The column ehr.ehr_status.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.ehr_status.name. + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.ref. + */ + public final TableField REF = createField(DSL.name("ref"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.scheme. + */ + public final TableField SCHEME = + createField(DSL.name("scheme"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.namespace. + */ + public final TableField NAMESPACE = + createField(DSL.name("namespace"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.type. + */ + public final TableField TYPE = createField(DSL.name("type"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.id_value. + */ + public final TableField ID_VALUE = + createField(DSL.name("id_value"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.issuer. + */ + public final TableField ISSUER = + createField(DSL.name("issuer"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.assigner. + */ + public final TableField ASSIGNER = + createField(DSL.name("assigner"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.type_name. + */ + public final TableField TYPE_NAME = + createField(DSL.name("type_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status.party. + */ + public final TableField PARTY = createField(DSL.name("party"), SQLDataType.UUID, this, ""); + + private EhrStatus(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrStatus(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment(""), + TableOptions.view( + """ + create view "ehr_status" as SELECT ehr.id, + party.name, + party.party_ref_value AS ref, + party.party_ref_scheme AS scheme, + party.party_ref_namespace AS namespace, + party.party_ref_type AS type, + identifier.id_value, + identifier.issuer, + identifier.assigner, + identifier.type_name, + identifier.party + FROM (((ehr.ehr ehr + JOIN ehr.status status ON ((status.ehr_id = ehr.id))) + JOIN ehr.party_identified party ON ((status.party = party.id))) + LEFT JOIN ehr.identifier identifier ON ((identifier.party = party.id))); + """)); + } + + /** + * Create an aliased ehr.ehr_status table reference + */ + public EhrStatus(String alias) { + this(DSL.name(alias), EHR_STATUS); + } + + /** + * Create an aliased ehr.ehr_status table reference + */ + public EhrStatus(Name alias) { + this(alias, EHR_STATUS); + } + + /** + * Create a ehr.ehr_status table reference + */ + public EhrStatus() { + this(DSL.name("ehr_status"), null); + } + + public EhrStatus(Table child, ForeignKey key) { + super(child, key, EHR_STATUS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public EhrStatus as(String alias) { + return new EhrStatus(DSL.name(alias), this); + } + + @Override + public EhrStatus as(Name alias) { + return new EhrStatus(alias, this); + } + + @Override + public EhrStatus as(Table alias) { + return new EhrStatus(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrStatus rename(String name) { + return new EhrStatus(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrStatus rename(Name name) { + return new EhrStatus(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrStatus rename(Table name) { + return new EhrStatus(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function11< + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super UUID, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function11< + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super UUID, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Entry.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Entry.java new file mode 100644 index 0000000..74c6a9e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Entry.java @@ -0,0 +1,377 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.EntryType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EntryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function14; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row14; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * this table hold the actual archetyped data values (fromBinder a template) + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Entry extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.entry + */ + public static final Entry ENTRY = new Entry(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EntryRecord.class; + } + + /** + * The column ehr.entry.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.entry.composition_id. + */ + public final TableField COMPOSITION_ID = + createField(DSL.name("composition_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.entry.sequence. + */ + public final TableField SEQUENCE = + createField(DSL.name("sequence"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.entry.item_type. + */ + public final TableField ITEM_TYPE = createField( + DSL.name("item_type"), + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.EntryType.class), + this, + ""); + + /** + * The column ehr.entry.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.entry.template_uuid. + */ + public final TableField TEMPLATE_UUID = + createField(DSL.name("template_uuid"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.entry.archetype_id. + */ + public final TableField ARCHETYPE_ID = + createField(DSL.name("archetype_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.entry.category. + */ + public final TableField CATEGORY = createField( + DSL.name("category"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.entry.entry. + */ + public final TableField ENTRY_ = createField(DSL.name("entry"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.entry.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.entry.sys_period. + */ + public final TableField> SYS_PERIOD = + createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.entry.rm_version. + */ + public final TableField RM_VERSION = createField( + DSL.name("rm_version"), + SQLDataType.CLOB.nullable(false).defaultValue(DSL.field(DSL.raw("'1.0.4'::text"), SQLDataType.CLOB)), + this, + ""); + + /** + * The column ehr.entry.name. + */ + public final TableField NAME = createField( + DSL.name("name"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.entry.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Entry(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Entry(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("this table hold the actual archetyped data values (fromBinder a template)"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.entry table reference + */ + public Entry(String alias) { + this(DSL.name(alias), ENTRY); + } + + /** + * Create an aliased ehr.entry table reference + */ + public Entry(Name alias) { + this(alias, ENTRY); + } + + /** + * Create a ehr.entry table reference + */ + public Entry() { + this(DSL.name("entry"), null); + } + + public Entry(Table child, ForeignKey key) { + super(child, key, ENTRY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TEMPLATE_ENTRY_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ENTRY_PKEY; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.ENTRY_COMPOSITION_ID_KEY); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.ENTRY__ENTRY_COMPOSITION_ID_FKEY, Keys.ENTRY__ENTRY_SYS_TENANT_FKEY); + } + + private transient Composition _composition; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.composition table. + */ + public Composition composition() { + if (_composition == null) _composition = new Composition(this, Keys.ENTRY__ENTRY_COMPOSITION_ID_FKEY); + + return _composition; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.ENTRY__ENTRY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Entry as(String alias) { + return new Entry(DSL.name(alias), this); + } + + @Override + public Entry as(Name alias) { + return new Entry(alias, this); + } + + @Override + public Entry as(Table alias) { + return new Entry(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Entry rename(String name) { + return new Entry(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Entry rename(Name name) { + return new Entry(name, null); + } + + /** + * Rename this table + */ + @Override + public Entry rename(Table name) { + return new Entry(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row14 type methods + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function14< + ? super UUID, + ? super UUID, + ? super Integer, + ? super EntryType, + ? super String, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super JSONB, + ? super Timestamp, + ? super SimpleEntry, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function14< + ? super UUID, + ? super UUID, + ? super Integer, + ? super EntryType, + ? super String, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super JSONB, + ? super Timestamp, + ? super SimpleEntry, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EntryHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EntryHistory.java new file mode 100644 index 0000000..7c11017 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EntryHistory.java @@ -0,0 +1,345 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.EntryType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EntryHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function14; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row14; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EntryHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.entry_history + */ + public static final EntryHistory ENTRY_HISTORY = new EntryHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EntryHistoryRecord.class; + } + + /** + * The column ehr.entry_history.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.entry_history.composition_id. + */ + public final TableField COMPOSITION_ID = + createField(DSL.name("composition_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.entry_history.sequence. + */ + public final TableField SEQUENCE = + createField(DSL.name("sequence"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.entry_history.item_type. + */ + public final TableField ITEM_TYPE = createField( + DSL.name("item_type"), + SQLDataType.VARCHAR.asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.EntryType.class), + this, + ""); + + /** + * The column ehr.entry_history.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.entry_history.template_uuid. + */ + public final TableField TEMPLATE_UUID = + createField(DSL.name("template_uuid"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.entry_history.archetype_id. + */ + public final TableField ARCHETYPE_ID = + createField(DSL.name("archetype_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.entry_history.category. + */ + public final TableField CATEGORY = createField( + DSL.name("category"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.entry_history.entry. + */ + public final TableField ENTRY = + createField(DSL.name("entry"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.entry_history.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.entry_history.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.entry_history.rm_version. + */ + public final TableField RM_VERSION = + createField(DSL.name("rm_version"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.entry_history.name. + */ + public final TableField NAME = createField( + DSL.name("name"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.entry_history.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private EntryHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EntryHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.entry_history table reference + */ + public EntryHistory(String alias) { + this(DSL.name(alias), ENTRY_HISTORY); + } + + /** + * Create an aliased ehr.entry_history table reference + */ + public EntryHistory(Name alias) { + this(alias, ENTRY_HISTORY); + } + + /** + * Create a ehr.entry_history table reference + */ + public EntryHistory() { + this(DSL.name("entry_history"), null); + } + + public EntryHistory(Table child, ForeignKey key) { + super(child, key, ENTRY_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_ENTRY_HISTORY, Indexes.ENTRY_HISTORY_COMPOSITION_IDX); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.ENTRY_HISTORY__ENTRY_HISTORY_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.ENTRY_HISTORY__ENTRY_HISTORY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public EntryHistory as(String alias) { + return new EntryHistory(DSL.name(alias), this); + } + + @Override + public EntryHistory as(Name alias) { + return new EntryHistory(alias, this); + } + + @Override + public EntryHistory as(Table alias) { + return new EntryHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EntryHistory rename(String name) { + return new EntryHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EntryHistory rename(Name name) { + return new EntryHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EntryHistory rename(Table name) { + return new EntryHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row14 type methods + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function14< + ? super UUID, + ? super UUID, + ? super Integer, + ? super EntryType, + ? super String, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super JSONB, + ? super Timestamp, + ? super SimpleEntry, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function14< + ? super UUID, + ? super UUID, + ? super Integer, + ? super EntryType, + ? super String, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super JSONB, + ? super Timestamp, + ? super SimpleEntry, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContext.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContext.java new file mode 100644 index 0000000..d691268 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContext.java @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EventContextRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function13; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row13; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * defines the context of an event (time, who, where... see openEHR IM 5.2 + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EventContext extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.event_context + */ + public static final EventContext EVENT_CONTEXT = new EventContext(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EventContextRecord.class; + } + + /** + * The column ehr.event_context.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.event_context.composition_id. + */ + public final TableField COMPOSITION_ID = + createField(DSL.name("composition_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.event_context.start_time. + */ + public final TableField START_TIME = + createField(DSL.name("start_time"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.event_context.start_time_tzid. + */ + public final TableField START_TIME_TZID = + createField(DSL.name("start_time_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.event_context.end_time. + */ + public final TableField END_TIME = + createField(DSL.name("end_time"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.event_context.end_time_tzid. + */ + public final TableField END_TIME_TZID = + createField(DSL.name("end_time_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.event_context.facility. + */ + public final TableField FACILITY = + createField(DSL.name("facility"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.event_context.location. + */ + public final TableField LOCATION = + createField(DSL.name("location"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.event_context.other_context. + */ + public final TableField OTHER_CONTEXT = + createField(DSL.name("other_context"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.event_context.setting. + */ + public final TableField SETTING = createField( + DSL.name("setting"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.event_context.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.event_context.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.event_context.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private EventContext(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EventContext(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("defines the context of an event (time, who, where... see openEHR IM 5.2"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.event_context table reference + */ + public EventContext(String alias) { + this(DSL.name(alias), EVENT_CONTEXT); + } + + /** + * Create an aliased ehr.event_context table reference + */ + public EventContext(Name alias) { + this(alias, EVENT_CONTEXT); + } + + /** + * Create a ehr.event_context table reference + */ + public EventContext() { + this(DSL.name("event_context"), null); + } + + public EventContext(Table child, ForeignKey key) { + super(child, key, EVENT_CONTEXT); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList( + Indexes.CONTEXT_COMPOSITION_ID_IDX, Indexes.CONTEXT_FACILITY_IDX, Indexes.CONTEXT_SETTING_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EVENT_CONTEXT_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EVENT_CONTEXT__EVENT_CONTEXT_COMPOSITION_ID_FKEY, + Keys.EVENT_CONTEXT__EVENT_CONTEXT_FACILITY_FKEY, + Keys.EVENT_CONTEXT__EVENT_CONTEXT_SYS_TENANT_FKEY); + } + + private transient Composition _composition; + private transient PartyIdentified _partyIdentified; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.composition table. + */ + public Composition composition() { + if (_composition == null) + _composition = new Composition(this, Keys.EVENT_CONTEXT__EVENT_CONTEXT_COMPOSITION_ID_FKEY); + + return _composition; + } + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) + _partyIdentified = new PartyIdentified(this, Keys.EVENT_CONTEXT__EVENT_CONTEXT_FACILITY_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.EVENT_CONTEXT__EVENT_CONTEXT_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public EventContext as(String alias) { + return new EventContext(DSL.name(alias), this); + } + + @Override + public EventContext as(Name alias) { + return new EventContext(alias, this); + } + + @Override + public EventContext as(Table alias) { + return new EventContext(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EventContext rename(String name) { + return new EventContext(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EventContext rename(Name name) { + return new EventContext(name, null); + } + + /** + * Rename this table + */ + @Override + public EventContext rename(Table name) { + return new EventContext(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row13 type methods + // ------------------------------------------------------------------------- + + @Override + public Row13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> + fieldsRow() { + return (Row13) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function13< + ? super UUID, + ? super UUID, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super String, + ? super UUID, + ? super String, + ? super JSONB, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super SimpleEntry, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function13< + ? super UUID, + ? super UUID, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super String, + ? super UUID, + ? super String, + ? super JSONB, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super SimpleEntry, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContextHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContextHistory.java new file mode 100644 index 0000000..3aadc23 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/EventContextHistory.java @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.EventContextHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function13; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row13; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EventContextHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.event_context_history + */ + public static final EventContextHistory EVENT_CONTEXT_HISTORY = new EventContextHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EventContextHistoryRecord.class; + } + + /** + * The column ehr.event_context_history.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.event_context_history.composition_id. + */ + public final TableField COMPOSITION_ID = + createField(DSL.name("composition_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.event_context_history.start_time. + */ + public final TableField START_TIME = + createField(DSL.name("start_time"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.event_context_history.start_time_tzid. + */ + public final TableField START_TIME_TZID = + createField(DSL.name("start_time_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.event_context_history.end_time. + */ + public final TableField END_TIME = + createField(DSL.name("end_time"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.event_context_history.end_time_tzid. + */ + public final TableField END_TIME_TZID = + createField(DSL.name("end_time_tzid"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.event_context_history.facility. + */ + public final TableField FACILITY = + createField(DSL.name("facility"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.event_context_history.location. + */ + public final TableField LOCATION = + createField(DSL.name("location"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.event_context_history.other_context. + */ + public final TableField OTHER_CONTEXT = + createField(DSL.name("other_context"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.event_context_history.setting. + */ + public final TableField SETTING = createField( + DSL.name("setting"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.event_context_history.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.event_context_history.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.event_context_history.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private EventContextHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EventContextHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.event_context_history table reference + */ + public EventContextHistory(String alias) { + this(DSL.name(alias), EVENT_CONTEXT_HISTORY); + } + + /** + * Create an aliased ehr.event_context_history table reference + */ + public EventContextHistory(Name alias) { + this(alias, EVENT_CONTEXT_HISTORY); + } + + /** + * Create a ehr.event_context_history table reference + */ + public EventContextHistory() { + this(DSL.name("event_context_history"), null); + } + + public EventContextHistory(Table child, ForeignKey key) { + super(child, key, EVENT_CONTEXT_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_EVENT_CONTEXT_HISTORY, Indexes.EVENT_CONTEXT_HISTORY_COMPOSITION_IDX); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.EVENT_CONTEXT_HISTORY__EVENT_CONTEXT_HISTORY_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) + _tenant = new Tenant(this, Keys.EVENT_CONTEXT_HISTORY__EVENT_CONTEXT_HISTORY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public EventContextHistory as(String alias) { + return new EventContextHistory(DSL.name(alias), this); + } + + @Override + public EventContextHistory as(Name alias) { + return new EventContextHistory(alias, this); + } + + @Override + public EventContextHistory as(Table alias) { + return new EventContextHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EventContextHistory rename(String name) { + return new EventContextHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EventContextHistory rename(Name name) { + return new EventContextHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EventContextHistory rename(Table name) { + return new EventContextHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row13 type methods + // ------------------------------------------------------------------------- + + @Override + public Row13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> + fieldsRow() { + return (Row13) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function13< + ? super UUID, + ? super UUID, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super String, + ? super UUID, + ? super String, + ? super JSONB, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super SimpleEntry, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function13< + ? super UUID, + ? super UUID, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super String, + ? super UUID, + ? super String, + ? super JSONB, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super SimpleEntry, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/FlywaySchemaHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/FlywaySchemaHistory.java new file mode 100644 index 0000000..d9a00f6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/FlywaySchemaHistory.java @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.FlywaySchemaHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function10; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row10; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class FlywaySchemaHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.flyway_schema_history + */ + public static final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = new FlywaySchemaHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return FlywaySchemaHistoryRecord.class; + } + + /** + * The column ehr.flyway_schema_history.installed_rank. + */ + public final TableField INSTALLED_RANK = + createField(DSL.name("installed_rank"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.version. + */ + public final TableField VERSION = + createField(DSL.name("version"), SQLDataType.VARCHAR(50), this, ""); + + /** + * The column ehr.flyway_schema_history.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.VARCHAR(200).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.type. + */ + public final TableField TYPE = + createField(DSL.name("type"), SQLDataType.VARCHAR(20).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.script. + */ + public final TableField SCRIPT = + createField(DSL.name("script"), SQLDataType.VARCHAR(1000).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.checksum. + */ + public final TableField CHECKSUM = + createField(DSL.name("checksum"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.flyway_schema_history.installed_by. + */ + public final TableField INSTALLED_BY = + createField(DSL.name("installed_by"), SQLDataType.VARCHAR(100).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.installed_on. + */ + public final TableField INSTALLED_ON = createField( + DSL.name("installed_on"), + SQLDataType.TIMESTAMP(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), + this, + ""); + + /** + * The column ehr.flyway_schema_history.execution_time. + */ + public final TableField EXECUTION_TIME = + createField(DSL.name("execution_time"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.success. + */ + public final TableField SUCCESS = + createField(DSL.name("success"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + private FlywaySchemaHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private FlywaySchemaHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.flyway_schema_history table reference + */ + public FlywaySchemaHistory(String alias) { + this(DSL.name(alias), FLYWAY_SCHEMA_HISTORY); + } + + /** + * Create an aliased ehr.flyway_schema_history table reference + */ + public FlywaySchemaHistory(Name alias) { + this(alias, FLYWAY_SCHEMA_HISTORY); + } + + /** + * Create a ehr.flyway_schema_history table reference + */ + public FlywaySchemaHistory() { + this(DSL.name("flyway_schema_history"), null); + } + + public FlywaySchemaHistory(Table child, ForeignKey key) { + super(child, key, FLYWAY_SCHEMA_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FLYWAY_SCHEMA_HISTORY_S_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FLYWAY_SCHEMA_HISTORY_PK; + } + + @Override + public FlywaySchemaHistory as(String alias) { + return new FlywaySchemaHistory(DSL.name(alias), this); + } + + @Override + public FlywaySchemaHistory as(Name alias) { + return new FlywaySchemaHistory(alias, this); + } + + @Override + public FlywaySchemaHistory as(Table alias) { + return new FlywaySchemaHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(String name) { + return new FlywaySchemaHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(Name name) { + return new FlywaySchemaHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(Table name) { + return new FlywaySchemaHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row10 type methods + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function10< + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super String, + ? super Timestamp, + ? super Integer, + ? super Boolean, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function10< + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super String, + ? super Timestamp, + ? super Integer, + ? super Boolean, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Heading.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Heading.java new file mode 100644 index 0000000..bf7a3be --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Heading.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.HeadingRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Heading extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.heading + */ + public static final Heading HEADING = new Heading(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return HeadingRecord.class; + } + + /** + * The column ehr.heading.code. + */ + public final TableField CODE = + createField(DSL.name("code"), SQLDataType.VARCHAR(16).nullable(false), this, ""); + + /** + * The column ehr.heading.name. + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.heading.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.heading.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Heading(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Heading(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.heading table reference + */ + public Heading(String alias) { + this(DSL.name(alias), HEADING); + } + + /** + * Create an aliased ehr.heading table reference + */ + public Heading(Name alias) { + this(alias, HEADING); + } + + /** + * Create a ehr.heading table reference + */ + public Heading() { + this(DSL.name("heading"), null); + } + + public Heading(Table child, ForeignKey key) { + super(child, key, HEADING); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.HEADING_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.HEADING__HEADING_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.HEADING__HEADING_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Heading as(String alias) { + return new Heading(DSL.name(alias), this); + } + + @Override + public Heading as(Name alias) { + return new Heading(alias, this); + } + + @Override + public Heading as(Table alias) { + return new Heading(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Heading rename(String name) { + return new Heading(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Heading rename(Name name) { + return new Heading(name, null); + } + + /** + * Rename this table + */ + @Override + public Heading rename(Table name) { + return new Heading(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Identifier.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Identifier.java new file mode 100644 index 0000000..958ad17 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Identifier.java @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.IdentifierRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function6; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * specifies an identifier for a party identified, more than one identifier is + * possible + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Identifier extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.identifier + */ + public static final Identifier IDENTIFIER = new Identifier(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return IdentifierRecord.class; + } + + /** + * The column ehr.identifier.id_value. + */ + public final TableField ID_VALUE = + createField(DSL.name("id_value"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.identifier.issuer. + */ + public final TableField ISSUER = + createField(DSL.name("issuer"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.identifier.assigner. + */ + public final TableField ASSIGNER = + createField(DSL.name("assigner"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.identifier.type_name. + */ + public final TableField TYPE_NAME = + createField(DSL.name("type_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.identifier.party. + */ + public final TableField PARTY = + createField(DSL.name("party"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.identifier.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Identifier(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Identifier(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("specifies an identifier for a party identified, more than one identifier is possible"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.identifier table reference + */ + public Identifier(String alias) { + this(DSL.name(alias), IDENTIFIER); + } + + /** + * Create an aliased ehr.identifier table reference + */ + public Identifier(Name alias) { + this(alias, IDENTIFIER); + } + + /** + * Create a ehr.identifier table reference + */ + public Identifier() { + this(DSL.name("identifier"), null); + } + + public Identifier(Table child, ForeignKey key) { + super(child, key, IDENTIFIER); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_IDENTIFIER_PARTY_IDX, Indexes.IDENTIFIER_VALUE_IDX); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.IDENTIFIER__IDENTIFIER_PARTY_FKEY, Keys.IDENTIFIER__IDENTIFIER_SYS_TENANT_FKEY); + } + + private transient PartyIdentified _partyIdentified; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) + _partyIdentified = new PartyIdentified(this, Keys.IDENTIFIER__IDENTIFIER_PARTY_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.IDENTIFIER__IDENTIFIER_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Identifier as(String alias) { + return new Identifier(DSL.name(alias), this); + } + + @Override + public Identifier as(Name alias) { + return new Identifier(alias, this); + } + + @Override + public Identifier as(Table alias) { + return new Identifier(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Identifier rename(String name) { + return new Identifier(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Identifier rename(Name name) { + return new Identifier(name, null); + } + + /** + * Rename this table + */ + @Override + public Identifier rename(Table name) { + return new Identifier(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function6< + ? super String, + ? super String, + ? super String, + ? super String, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function6< + ? super String, + ? super String, + ? super String, + ? super String, + ? super UUID, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/JsonbArrayElements.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/JsonbArrayElements.java new file mode 100644 index 0000000..ca01738 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/JsonbArrayElements.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.JsonbArrayElementsRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonbArrayElements extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.jsonb_array_elements + */ + public static final JsonbArrayElements JSONB_ARRAY_ELEMENTS = new JsonbArrayElements(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JsonbArrayElementsRecord.class; + } + + /** + * The column ehr.jsonb_array_elements.jsonb_array_elements. + */ + public final TableField JSONB_ARRAY_ELEMENTS_ = + createField(DSL.name("jsonb_array_elements"), SQLDataType.JSONB, this, ""); + + private JsonbArrayElements(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.JSONB)}); + } + + private JsonbArrayElements(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.jsonb_array_elements table reference + */ + public JsonbArrayElements(String alias) { + this(DSL.name(alias), JSONB_ARRAY_ELEMENTS); + } + + /** + * Create an aliased ehr.jsonb_array_elements table reference + */ + public JsonbArrayElements(Name alias) { + this(alias, JSONB_ARRAY_ELEMENTS); + } + + /** + * Create a ehr.jsonb_array_elements table reference + */ + public JsonbArrayElements() { + this(DSL.name("jsonb_array_elements"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public JsonbArrayElements as(String alias) { + return new JsonbArrayElements(DSL.name(alias), this, parameters); + } + + @Override + public JsonbArrayElements as(Name alias) { + return new JsonbArrayElements(alias, this, parameters); + } + + @Override + public JsonbArrayElements as(Table alias) { + return new JsonbArrayElements(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public JsonbArrayElements rename(String name) { + return new JsonbArrayElements(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public JsonbArrayElements rename(Name name) { + return new JsonbArrayElements(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public JsonbArrayElements rename(Table name) { + return new JsonbArrayElements(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public JsonbArrayElements call(JSONB jsonbVal) { + JsonbArrayElements result = new JsonbArrayElements( + DSL.name("jsonb_array_elements"), null, new Field[] {DSL.val(jsonbVal, SQLDataType.JSONB)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public JsonbArrayElements call(Field jsonbVal) { + JsonbArrayElements result = + new JsonbArrayElements(DSL.name("jsonb_array_elements"), null, new Field[] {jsonbVal}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Language.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Language.java new file mode 100644 index 0000000..d31403f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Language.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.LanguageRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * ISO 639-1 language codeset + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Language extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.language + */ + public static final Language LANGUAGE = new Language(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return LanguageRecord.class; + } + + /** + * The column ehr.language.code. + */ + public final TableField CODE = + createField(DSL.name("code"), SQLDataType.VARCHAR(5).nullable(false), this, ""); + + /** + * The column ehr.language.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.CLOB.nullable(false), this, ""); + + private Language(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Language(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("ISO 639-1 language codeset"), TableOptions.table()); + } + + /** + * Create an aliased ehr.language table reference + */ + public Language(String alias) { + this(DSL.name(alias), LANGUAGE); + } + + /** + * Create an aliased ehr.language table reference + */ + public Language(Name alias) { + this(alias, LANGUAGE); + } + + /** + * Create a ehr.language table reference + */ + public Language() { + this(DSL.name("language"), null); + } + + public Language(Table child, ForeignKey key) { + super(child, key, LANGUAGE); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LANGUAGE_PKEY; + } + + @Override + public Language as(String alias) { + return new Language(DSL.name(alias), this); + } + + @Override + public Language as(Name alias) { + return new Language(alias, this); + } + + @Override + public Language as(Table alias) { + return new Language(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Language rename(String name) { + return new Language(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Language rename(Name name) { + return new Language(name, null); + } + + /** + * Rename this table + */ + @Override + public Language rename(Table name) { + return new Language(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Participation.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Participation.java new file mode 100644 index 0000000..0acdc85 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Participation.java @@ -0,0 +1,363 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ParticipationRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function12; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row12; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * define a participating party for an event f.ex. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Participation extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.participation + */ + public static final Participation PARTICIPATION = new Participation(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ParticipationRecord.class; + } + + /** + * The column ehr.participation.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.participation.event_context. + */ + public final TableField EVENT_CONTEXT = + createField(DSL.name("event_context"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.participation.performer. + */ + public final TableField PERFORMER = + createField(DSL.name("performer"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.participation.function. + */ + public final TableField FUNCTION = createField( + DSL.name("function"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.participation.mode. + */ + public final TableField MODE = createField( + DSL.name("mode"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.participation.time_lower. + */ + public final TableField TIME_LOWER = + createField(DSL.name("time_lower"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.participation.time_lower_tz. + */ + public final TableField TIME_LOWER_TZ = + createField(DSL.name("time_lower_tz"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.participation.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.participation.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.participation.time_upper. + */ + public final TableField TIME_UPPER = + createField(DSL.name("time_upper"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.participation.time_upper_tz. + */ + public final TableField TIME_UPPER_TZ = + createField(DSL.name("time_upper_tz"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.participation.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Participation(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Participation(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("define a participating party for an event f.ex."), + TableOptions.table()); + } + + /** + * Create an aliased ehr.participation table reference + */ + public Participation(String alias) { + this(DSL.name(alias), PARTICIPATION); + } + + /** + * Create an aliased ehr.participation table reference + */ + public Participation(Name alias) { + this(alias, PARTICIPATION); + } + + /** + * Create a ehr.participation table reference + */ + public Participation() { + this(DSL.name("participation"), null); + } + + public Participation(Table child, ForeignKey key) { + super(child, key, PARTICIPATION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CONTEXT_PARTICIPATION_INDEX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PARTICIPATION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.PARTICIPATION__PARTICIPATION_EVENT_CONTEXT_FKEY, + Keys.PARTICIPATION__PARTICIPATION_PERFORMER_FKEY, + Keys.PARTICIPATION__PARTICIPATION_SYS_TENANT_FKEY); + } + + private transient EventContext _eventContext; + private transient PartyIdentified _partyIdentified; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.event_context table. + */ + public EventContext eventContext() { + if (_eventContext == null) + _eventContext = new EventContext(this, Keys.PARTICIPATION__PARTICIPATION_EVENT_CONTEXT_FKEY); + + return _eventContext; + } + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) + _partyIdentified = new PartyIdentified(this, Keys.PARTICIPATION__PARTICIPATION_PERFORMER_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.PARTICIPATION__PARTICIPATION_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Participation as(String alias) { + return new Participation(DSL.name(alias), this); + } + + @Override + public Participation as(Name alias) { + return new Participation(alias, this); + } + + @Override + public Participation as(Table alias) { + return new Participation(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Participation rename(String name) { + return new Participation(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Participation rename(Name name) { + return new Participation(name, null); + } + + /** + * Rename this table + */ + @Override + public Participation rename(Table name) { + return new Participation(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row12 type methods + // ------------------------------------------------------------------------- + + @Override + public Row12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> + fieldsRow() { + return (Row12) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function12< + ? super UUID, + ? super UUID, + ? super UUID, + ? super DvCodedTextRecord, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super SimpleEntry, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function12< + ? super UUID, + ? super UUID, + ? super UUID, + ? super DvCodedTextRecord, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super SimpleEntry, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/ParticipationHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/ParticipationHistory.java new file mode 100644 index 0000000..9dc5281 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/ParticipationHistory.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.ParticipationHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function12; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row12; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class ParticipationHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.participation_history + */ + public static final ParticipationHistory PARTICIPATION_HISTORY = new ParticipationHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ParticipationHistoryRecord.class; + } + + /** + * The column ehr.participation_history.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.participation_history.event_context. + */ + public final TableField EVENT_CONTEXT = + createField(DSL.name("event_context"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.participation_history.performer. + */ + public final TableField PERFORMER = + createField(DSL.name("performer"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.participation_history.function. + */ + public final TableField FUNCTION = createField( + DSL.name("function"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.participation_history.mode. + */ + public final TableField MODE = createField( + DSL.name("mode"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.participation_history.time_lower. + */ + public final TableField TIME_LOWER = + createField(DSL.name("time_lower"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.participation_history.time_lower_tz. + */ + public final TableField TIME_LOWER_TZ = + createField(DSL.name("time_lower_tz"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.participation_history.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.participation_history.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.participation_history.time_upper. + */ + public final TableField TIME_UPPER = + createField(DSL.name("time_upper"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.participation_history.time_upper_tz. + */ + public final TableField TIME_UPPER_TZ = + createField(DSL.name("time_upper_tz"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.participation_history.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private ParticipationHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private ParticipationHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.participation_history table reference + */ + public ParticipationHistory(String alias) { + this(DSL.name(alias), PARTICIPATION_HISTORY); + } + + /** + * Create an aliased ehr.participation_history table reference + */ + public ParticipationHistory(Name alias) { + this(alias, PARTICIPATION_HISTORY); + } + + /** + * Create a ehr.participation_history table reference + */ + public ParticipationHistory() { + this(DSL.name("participation_history"), null); + } + + public ParticipationHistory(Table child, ForeignKey key) { + super(child, key, PARTICIPATION_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_PARTICIPATION_HISTORY, Indexes.PARTICIPATION_HISTORY_EVENT_CONTEXT_IDX); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.PARTICIPATION_HISTORY__PARTICIPATION_HISTORY_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) + _tenant = new Tenant(this, Keys.PARTICIPATION_HISTORY__PARTICIPATION_HISTORY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public ParticipationHistory as(String alias) { + return new ParticipationHistory(DSL.name(alias), this); + } + + @Override + public ParticipationHistory as(Name alias) { + return new ParticipationHistory(alias, this); + } + + @Override + public ParticipationHistory as(Table alias) { + return new ParticipationHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ParticipationHistory rename(String name) { + return new ParticipationHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ParticipationHistory rename(Name name) { + return new ParticipationHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public ParticipationHistory rename(Table name) { + return new ParticipationHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row12 type methods + // ------------------------------------------------------------------------- + + @Override + public Row12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> + fieldsRow() { + return (Row12) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function12< + ? super UUID, + ? super UUID, + ? super UUID, + ? super DvCodedTextRecord, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super SimpleEntry, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function12< + ? super UUID, + ? super UUID, + ? super UUID, + ? super DvCodedTextRecord, + ? super DvCodedTextRecord, + ? super Timestamp, + ? super String, + ? super Timestamp, + ? super SimpleEntry, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyIdentified.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyIdentified.java new file mode 100644 index 0000000..7cfd27b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyIdentified.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyIdentifiedRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function10; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row10; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PartyIdentified extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.party_identified + */ + public static final PartyIdentified PARTY_IDENTIFIED = new PartyIdentified(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return PartyIdentifiedRecord.class; + } + + /** + * The column ehr.party_identified.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.party_identified.name. + */ + public final TableField NAME = + createField(DSL.name("name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.party_identified.party_ref_value. + */ + public final TableField PARTY_REF_VALUE = + createField(DSL.name("party_ref_value"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.party_identified.party_ref_scheme. + */ + public final TableField PARTY_REF_SCHEME = + createField(DSL.name("party_ref_scheme"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.party_identified.party_ref_namespace. + */ + public final TableField PARTY_REF_NAMESPACE = + createField(DSL.name("party_ref_namespace"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.party_identified.party_ref_type. + */ + public final TableField PARTY_REF_TYPE = + createField(DSL.name("party_ref_type"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.party_identified.party_type. + */ + public final TableField PARTY_TYPE = createField( + DSL.name("party_type"), + SQLDataType.VARCHAR + .defaultValue(DSL.field(DSL.raw("'party_identified'::ehr.party_type"), SQLDataType.VARCHAR)) + .asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyType.class), + this, + ""); + + /** + * The column ehr.party_identified.relationship. + */ + public final TableField RELATIONSHIP = createField( + DSL.name("relationship"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.party_identified.object_id_type. + */ + public final TableField OBJECT_ID_TYPE = createField( + DSL.name("object_id_type"), + SQLDataType.VARCHAR + .defaultValue(DSL.field(DSL.raw("'generic_id'::ehr.party_ref_id_type"), SQLDataType.VARCHAR)) + .asEnumDataType(org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType.class), + this, + ""); + + /** + * The column ehr.party_identified.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private PartyIdentified(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private PartyIdentified(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.party_identified table reference + */ + public PartyIdentified(String alias) { + this(DSL.name(alias), PARTY_IDENTIFIED); + } + + /** + * Create an aliased ehr.party_identified table reference + */ + public PartyIdentified(Name alias) { + this(alias, PARTY_IDENTIFIED); + } + + /** + * Create a ehr.party_identified table reference + */ + public PartyIdentified() { + this(DSL.name("party_identified"), null); + } + + public PartyIdentified(Table child, ForeignKey key) { + super(child, key, PARTY_IDENTIFIED); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList( + Indexes.PARTY_IDENTIFIED_NAMESPACE_VALUE_IDX, + Indexes.PARTY_IDENTIFIED_PARTY_REF_IDX, + Indexes.PARTY_IDENTIFIED_PARTY_TYPE_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PARTY_IDENTIFIED_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.PARTY_IDENTIFIED__PARTY_IDENTIFIED_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.PARTY_IDENTIFIED__PARTY_IDENTIFIED_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public PartyIdentified as(String alias) { + return new PartyIdentified(DSL.name(alias), this); + } + + @Override + public PartyIdentified as(Name alias) { + return new PartyIdentified(alias, this); + } + + @Override + public PartyIdentified as(Table alias) { + return new PartyIdentified(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public PartyIdentified rename(String name) { + return new PartyIdentified(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public PartyIdentified rename(Name name) { + return new PartyIdentified(name, null); + } + + /** + * Rename this table + */ + @Override + public PartyIdentified rename(Table name) { + return new PartyIdentified(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row10 type methods + // ------------------------------------------------------------------------- + + @Override + public Row10 + fieldsRow() { + return (Row10) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function10< + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super PartyType, + ? super DvCodedTextRecord, + ? super PartyRefIdType, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function10< + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super PartyType, + ? super DvCodedTextRecord, + ? super PartyRefIdType, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyUsageIdentification.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyUsageIdentification.java new file mode 100644 index 0000000..23cf805 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/PartyUsageIdentification.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PartyUsageIdentificationRecord; +import org.jooq.Field; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PartyUsageIdentification extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.party_usage_identification + */ + public static final PartyUsageIdentification PARTY_USAGE_IDENTIFICATION = new PartyUsageIdentification(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return PartyUsageIdentificationRecord.class; + } + + /** + * The column ehr.party_usage_identification.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.party_usage_identification.entity. + */ + public final TableField ENTITY = + createField(DSL.name("entity"), SQLDataType.CLOB, this, ""); + + private PartyUsageIdentification(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.UUID)}); + } + + private PartyUsageIdentification(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.party_usage_identification table + * reference + */ + public PartyUsageIdentification(String alias) { + this(DSL.name(alias), PARTY_USAGE_IDENTIFICATION); + } + + /** + * Create an aliased ehr.party_usage_identification table + * reference + */ + public PartyUsageIdentification(Name alias) { + this(alias, PARTY_USAGE_IDENTIFICATION); + } + + /** + * Create a ehr.party_usage_identification table reference + */ + public PartyUsageIdentification() { + this(DSL.name("party_usage_identification"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public PartyUsageIdentification as(String alias) { + return new PartyUsageIdentification(DSL.name(alias), this, parameters); + } + + @Override + public PartyUsageIdentification as(Name alias) { + return new PartyUsageIdentification(alias, this, parameters); + } + + @Override + public PartyUsageIdentification as(Table alias) { + return new PartyUsageIdentification(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public PartyUsageIdentification rename(String name) { + return new PartyUsageIdentification(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public PartyUsageIdentification rename(Name name) { + return new PartyUsageIdentification(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public PartyUsageIdentification rename(Table name) { + return new PartyUsageIdentification(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public PartyUsageIdentification call(UUID partyUuid) { + PartyUsageIdentification result = new PartyUsageIdentification( + DSL.name("party_usage_identification"), null, new Field[] {DSL.val(partyUuid, SQLDataType.UUID)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public PartyUsageIdentification call(Field partyUuid) { + PartyUsageIdentification result = + new PartyUsageIdentification(DSL.name("party_usage_identification"), null, new Field[] {partyUuid}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Plugin.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Plugin.java new file mode 100644 index 0000000..1c921d8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Plugin.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.PluginRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * key value store for plugin sub system + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Plugin extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.plugin + */ + public static final Plugin PLUGIN = new Plugin(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return PluginRecord.class; + } + + /** + * The column ehr.plugin.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.plugin.pluginid. + */ + public final TableField PLUGINID = + createField(DSL.name("pluginid"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.plugin.key. + */ + public final TableField KEY = + createField(DSL.name("key"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.plugin.value. + */ + public final TableField VALUE = createField(DSL.name("value"), SQLDataType.CLOB, this, ""); + + private Plugin(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Plugin(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("key value store for plugin sub system"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.plugin table reference + */ + public Plugin(String alias) { + this(DSL.name(alias), PLUGIN); + } + + /** + * Create an aliased ehr.plugin table reference + */ + public Plugin(Name alias) { + this(alias, PLUGIN); + } + + /** + * Create a ehr.plugin table reference + */ + public Plugin() { + this(DSL.name("plugin"), null); + } + + public Plugin(Table child, ForeignKey key) { + super(child, key, PLUGIN); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PLUGIN_PKEY; + } + + @Override + public Plugin as(String alias) { + return new Plugin(DSL.name(alias), this); + } + + @Override + public Plugin as(Name alias) { + return new Plugin(alias, this); + } + + @Override + public Plugin as(Table alias) { + return new Plugin(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Plugin rename(String name) { + return new Plugin(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Plugin rename(Name name) { + return new Plugin(name, null); + } + + /** + * Rename this table + */ + @Override + public Plugin rename(Table name) { + return new Plugin(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/SessionLog.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/SessionLog.java new file mode 100644 index 0000000..c6e72c5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/SessionLog.java @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.SessionLogRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function8; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row8; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class SessionLog extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.session_log + */ + public static final SessionLog SESSION_LOG = new SessionLog(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return SessionLogRecord.class; + } + + /** + * The column ehr.session_log.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.session_log.subject_id. + */ + public final TableField SUBJECT_ID = + createField(DSL.name("subject_id"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.session_log.node_id. + */ + public final TableField NODE_ID = + createField(DSL.name("node_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.session_log.session_id. + */ + public final TableField SESSION_ID = + createField(DSL.name("session_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.session_log.session_name. + */ + public final TableField SESSION_NAME = + createField(DSL.name("session_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.session_log.session_time. + */ + public final TableField SESSION_TIME = + createField(DSL.name("session_time"), SQLDataType.TIMESTAMP(6), this, ""); + + /** + * The column ehr.session_log.ip_address. + */ + public final TableField IP_ADDRESS = + createField(DSL.name("ip_address"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.session_log.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private SessionLog(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private SessionLog(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.session_log table reference + */ + public SessionLog(String alias) { + this(DSL.name(alias), SESSION_LOG); + } + + /** + * Create an aliased ehr.session_log table reference + */ + public SessionLog(Name alias) { + this(alias, SESSION_LOG); + } + + /** + * Create a ehr.session_log table reference + */ + public SessionLog() { + this(DSL.name("session_log"), null); + } + + public SessionLog(Table child, ForeignKey key) { + super(child, key, SESSION_LOG); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SESSION_LOG_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.SESSION_LOG__SESSION_LOG_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.SESSION_LOG__SESSION_LOG_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public SessionLog as(String alias) { + return new SessionLog(DSL.name(alias), this); + } + + @Override + public SessionLog as(Name alias) { + return new SessionLog(alias, this); + } + + @Override + public SessionLog as(Table alias) { + return new SessionLog(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public SessionLog rename(String name) { + return new SessionLog(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public SessionLog rename(Name name) { + return new SessionLog(name, null); + } + + /** + * Rename this table + */ + @Override + public SessionLog rename(Table name) { + return new SessionLog(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function8< + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function8< + ? super UUID, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Status.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Status.java new file mode 100644 index 0000000..2f0287c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Status.java @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import com.nedap.archie.rm.datastructures.ItemStructure; +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.OtherDetailsJsonbBinder; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StatusRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function14; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row14; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * specifies an ehr modality and ownership (patient) + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Status extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.status + */ + public static final Status STATUS = new Status(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return StatusRecord.class; + } + + /** + * The column ehr.status.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.status.ehr_id. + */ + public final TableField EHR_ID = createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.status.is_queryable. + */ + public final TableField IS_QUERYABLE = createField( + DSL.name("is_queryable"), + SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), + this, + ""); + + /** + * The column ehr.status.is_modifiable. + */ + public final TableField IS_MODIFIABLE = createField( + DSL.name("is_modifiable"), + SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), + this, + ""); + + /** + * The column ehr.status.party. + */ + public final TableField PARTY = + createField(DSL.name("party"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status.other_details. + */ + public final TableField OTHER_DETAILS = + createField(DSL.name("other_details"), SQLDataType.JSONB, this, "", new OtherDetailsJsonbBinder()); + + /** + * The column ehr.status.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.status.sys_period. + */ + public final TableField> SYS_PERIOD = + createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.status.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status.attestation_ref. + */ + public final TableField ATTESTATION_REF = + createField(DSL.name("attestation_ref"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.status.in_contribution. + */ + public final TableField IN_CONTRIBUTION = + createField(DSL.name("in_contribution"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status.archetype_node_id. + */ + public final TableField ARCHETYPE_NODE_ID = createField( + DSL.name("archetype_node_id"), + SQLDataType.CLOB + .nullable(false) + .defaultValue(DSL.field(DSL.raw("'openEHR-EHR-EHR_STATUS.generic.v1'::text"), SQLDataType.CLOB)), + this, + ""); + + /** + * The column ehr.status.name. + */ + public final TableField NAME = createField( + DSL.name("name"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.status.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Status(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Status(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("specifies an ehr modality and ownership (patient)"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.status table reference + */ + public Status(String alias) { + this(DSL.name(alias), STATUS); + } + + /** + * Create an aliased ehr.status table reference + */ + public Status(Name alias) { + this(alias, STATUS); + } + + /** + * Create a ehr.status table reference + */ + public Status() { + this(DSL.name("status"), null); + } + + public Status(Table child, ForeignKey key) { + super(child, key, STATUS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STATUS_PARTY_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STATUS_PKEY; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.STATUS_EHR_ID_KEY); + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.STATUS__STATUS_EHR_ID_FKEY, + Keys.STATUS__STATUS_PARTY_FKEY, + Keys.STATUS__STATUS_HAS_AUDIT_FKEY, + Keys.STATUS__STATUS_ATTESTATION_REF_FKEY, + Keys.STATUS__STATUS_IN_CONTRIBUTION_FKEY, + Keys.STATUS__STATUS_SYS_TENANT_FKEY); + } + + private transient org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr _ehr; + private transient PartyIdentified _partyIdentified; + private transient AuditDetails _auditDetails; + private transient AttestationRef _attestationRef; + private transient Contribution _contribution; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr(this, Keys.STATUS__STATUS_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) _partyIdentified = new PartyIdentified(this, Keys.STATUS__STATUS_PARTY_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) _auditDetails = new AuditDetails(this, Keys.STATUS__STATUS_HAS_AUDIT_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.attestation_ref table. + */ + public AttestationRef attestationRef() { + if (_attestationRef == null) + _attestationRef = new AttestationRef(this, Keys.STATUS__STATUS_ATTESTATION_REF_FKEY); + + return _attestationRef; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) _contribution = new Contribution(this, Keys.STATUS__STATUS_IN_CONTRIBUTION_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.STATUS__STATUS_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Status as(String alias) { + return new Status(DSL.name(alias), this); + } + + @Override + public Status as(Name alias) { + return new Status(alias, this); + } + + @Override + public Status as(Table alias) { + return new Status(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Status rename(String name) { + return new Status(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Status rename(Name name) { + return new Status(name, null); + } + + /** + * Rename this table + */ + @Override + public Status rename(Table name) { + return new Status(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row14 type methods + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function14< + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super UUID, + ? super ItemStructure, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function14< + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super UUID, + ? super ItemStructure, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StatusHistory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StatusHistory.java new file mode 100644 index 0000000..ea60046 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StatusHistory.java @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import com.nedap.archie.rm.datastructures.ItemStructure; +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.binding.OtherDetailsJsonbBinder; +import org.ehrbase.migration.exporter.v0.jooq.binding.SysPeriodBinder; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StatusHistoryRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function14; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row14; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class StatusHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.status_history + */ + public static final StatusHistory STATUS_HISTORY = new StatusHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return StatusHistoryRecord.class; + } + + /** + * The column ehr.status_history.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.status_history.is_queryable. + */ + public final TableField IS_QUERYABLE = + createField(DSL.name("is_queryable"), SQLDataType.BOOLEAN, this, ""); + + /** + * The column ehr.status_history.is_modifiable. + */ + public final TableField IS_MODIFIABLE = + createField(DSL.name("is_modifiable"), SQLDataType.BOOLEAN, this, ""); + + /** + * The column ehr.status_history.party. + */ + public final TableField PARTY = + createField(DSL.name("party"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status_history.other_details. + */ + public final TableField OTHER_DETAILS = + createField(DSL.name("other_details"), SQLDataType.JSONB, this, "", new OtherDetailsJsonbBinder()); + + /** + * The column ehr.status_history.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.status_history.sys_period. + */ + public final TableField> + SYS_PERIOD = createField( + DSL.name("sys_period"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tstzrange\"") + .nullable(false), + this, + "", + new SysPeriodBinder()); + + /** + * The column ehr.status_history.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status_history.attestation_ref. + */ + public final TableField ATTESTATION_REF = + createField(DSL.name("attestation_ref"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.status_history.in_contribution. + */ + public final TableField IN_CONTRIBUTION = + createField(DSL.name("in_contribution"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.status_history.archetype_node_id. + */ + public final TableField ARCHETYPE_NODE_ID = createField( + DSL.name("archetype_node_id"), + SQLDataType.CLOB + .nullable(false) + .defaultValue(DSL.field(DSL.raw("'openEHR-EHR-EHR_STATUS.generic.v1'::text"), SQLDataType.CLOB)), + this, + ""); + + /** + * The column ehr.status_history.name. + */ + public final TableField NAME = createField( + DSL.name("name"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText.DV_CODED_TEXT.getDataType(), + this, + ""); + + /** + * The column ehr.status_history.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private StatusHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private StatusHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.status_history table reference + */ + public StatusHistory(String alias) { + this(DSL.name(alias), STATUS_HISTORY); + } + + /** + * Create an aliased ehr.status_history table reference + */ + public StatusHistory(Name alias) { + this(alias, STATUS_HISTORY); + } + + /** + * Create a ehr.status_history table reference + */ + public StatusHistory() { + this(DSL.name("status_history"), null); + } + + public StatusHistory(Table child, ForeignKey key) { + super(child, key, STATUS_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_STATUS_HISTORY, Indexes.STATUS_HISTORY_EHR_IDX); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.STATUS_HISTORY__STATUS_HISTORY_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.STATUS_HISTORY__STATUS_HISTORY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public StatusHistory as(String alias) { + return new StatusHistory(DSL.name(alias), this); + } + + @Override + public StatusHistory as(Name alias) { + return new StatusHistory(alias, this); + } + + @Override + public StatusHistory as(Table alias) { + return new StatusHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public StatusHistory rename(String name) { + return new StatusHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public StatusHistory rename(Name name) { + return new StatusHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public StatusHistory rename(Table name) { + return new StatusHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row14 type methods + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function14< + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super UUID, + ? super ItemStructure, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function14< + ? super UUID, + ? super UUID, + ? super Boolean, + ? super Boolean, + ? super UUID, + ? super ItemStructure, + ? super Timestamp, + ? super SimpleEntry, + ? super UUID, + ? super UUID, + ? super UUID, + ? super String, + ? super DvCodedTextRecord, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StoredQuery.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StoredQuery.java new file mode 100644 index 0000000..a894b44 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/StoredQuery.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.StoredQueryRecord; +import org.jooq.Check; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function7; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row7; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class StoredQuery extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.stored_query + */ + public static final StoredQuery STORED_QUERY = new StoredQuery(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return StoredQueryRecord.class; + } + + /** + * The column ehr.stored_query.reverse_domain_name. + */ + public final TableField REVERSE_DOMAIN_NAME = + createField(DSL.name("reverse_domain_name"), SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column ehr.stored_query.semantic_id. + */ + public final TableField SEMANTIC_ID = + createField(DSL.name("semantic_id"), SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column ehr.stored_query.semver. + */ + public final TableField SEMVER = createField( + DSL.name("semver"), + SQLDataType.VARCHAR + .nullable(false) + .defaultValue(DSL.field(DSL.raw("'0.0.0'::character varying"), SQLDataType.VARCHAR)), + this, + ""); + + /** + * The column ehr.stored_query.query_text. + */ + public final TableField QUERY_TEXT = + createField(DSL.name("query_text"), SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column ehr.stored_query.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), + SQLDataType.TIMESTAMP(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMP)), + this, + ""); + + /** + * The column ehr.stored_query.type. + */ + public final TableField TYPE = createField( + DSL.name("type"), + SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'AQL'::character varying"), SQLDataType.VARCHAR)), + this, + ""); + + /** + * The column ehr.stored_query.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private StoredQuery(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private StoredQuery(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.stored_query table reference + */ + public StoredQuery(String alias) { + this(DSL.name(alias), STORED_QUERY); + } + + /** + * Create an aliased ehr.stored_query table reference + */ + public StoredQuery(Name alias) { + this(alias, STORED_QUERY); + } + + /** + * Create a ehr.stored_query table reference + */ + public StoredQuery() { + this(DSL.name("stored_query"), null); + } + + public StoredQuery(Table child, ForeignKey key) { + super(child, key, STORED_QUERY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STORED_QUERY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.STORED_QUERY__STORED_QUERY_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.STORED_QUERY__STORED_QUERY_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public List> getChecks() { + return Arrays.asList( + Internal.createCheck( + this, + DSL.name("stored_query_reverse_domain_name_check"), + "(((reverse_domain_name)::text ~* '^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$'::text))", + true), + Internal.createCheck( + this, + DSL.name("stored_query_semantic_id_check"), + "(((semantic_id)::text ~* '[\\w|\\-|_|]+'::text))", + true), + Internal.createCheck( + this, + DSL.name("stored_query_semver_check"), + "(((semver)::text ~* '^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?$'::text))", + true)); + } + + @Override + public StoredQuery as(String alias) { + return new StoredQuery(DSL.name(alias), this); + } + + @Override + public StoredQuery as(Name alias) { + return new StoredQuery(alias, this); + } + + @Override + public StoredQuery as(Table alias) { + return new StoredQuery(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public StoredQuery rename(String name) { + return new StoredQuery(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public StoredQuery rename(Name name) { + return new StoredQuery(name, null); + } + + /** + * Rename this table + */ + @Override + public StoredQuery rename(Table name) { + return new StoredQuery(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function7< + ? super String, + ? super String, + ? super String, + ? super String, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function7< + ? super String, + ? super String, + ? super String, + ? super String, + ? super Timestamp, + ? super String, + ? super Short, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/System.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/System.java new file mode 100644 index 0000000..59d569d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/System.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.SystemRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function3; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * system table for reference + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class System extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.system + */ + public static final System SYSTEM = new System(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return SystemRecord.class; + } + + /** + * The column ehr.system.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.system.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.system.settings. + */ + public final TableField SETTINGS = + createField(DSL.name("settings"), SQLDataType.CLOB.nullable(false), this, ""); + + private System(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private System(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("system table for reference"), TableOptions.table()); + } + + /** + * Create an aliased ehr.system table reference + */ + public System(String alias) { + this(DSL.name(alias), SYSTEM); + } + + /** + * Create an aliased ehr.system table reference + */ + public System(Name alias) { + this(alias, SYSTEM); + } + + /** + * Create a ehr.system table reference + */ + public System() { + this(DSL.name("system"), null); + } + + public System(Table child, ForeignKey key) { + super(child, key, SYSTEM); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_SYSTEM_SETTINGS_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SYSTEM_PKEY; + } + + @Override + public System as(String alias) { + return new System(DSL.name(alias), this); + } + + @Override + public System as(Name alias) { + return new System(alias, this); + } + + @Override + public System as(Table alias) { + return new System(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public System rename(String name) { + return new System(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public System rename(Name name) { + return new System(name, null); + } + + /** + * Rename this table + */ + @Override + public System rename(Table name) { + return new System(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TemplateStore.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TemplateStore.java new file mode 100644 index 0000000..44d3144 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TemplateStore.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TemplateStoreRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function5; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TemplateStore extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.template_store + */ + public static final TemplateStore TEMPLATE_STORE = new TemplateStore(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TemplateStoreRecord.class; + } + + /** + * The column ehr.template_store.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.template_store.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.template_store.content. + */ + public final TableField CONTENT = + createField(DSL.name("content"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.template_store.sys_transaction. + */ + public final TableField SYS_TRANSACTION = + createField(DSL.name("sys_transaction"), SQLDataType.TIMESTAMP(6).nullable(false), this, ""); + + /** + * The column ehr.template_store.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private TemplateStore(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TemplateStore(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.template_store table reference + */ + public TemplateStore(String alias) { + this(DSL.name(alias), TEMPLATE_STORE); + } + + /** + * Create an aliased ehr.template_store table reference + */ + public TemplateStore(Name alias) { + this(alias, TEMPLATE_STORE); + } + + /** + * Create a ehr.template_store table reference + */ + public TemplateStore() { + this(DSL.name("template_store"), null); + } + + public TemplateStore(Table child, ForeignKey key) { + super(child, key, TEMPLATE_STORE); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TEMPLATE_STORE_TEMPLATE_ID); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TEMPLATE_STORE_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.TEMPLATE_STORE__TEMPLATE_STORE_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.TEMPLATE_STORE__TEMPLATE_STORE_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public TemplateStore as(String alias) { + return new TemplateStore(DSL.name(alias), this); + } + + @Override + public TemplateStore as(Name alias) { + return new TemplateStore(alias, this); + } + + @Override + public TemplateStore as(Table alias) { + return new TemplateStore(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public TemplateStore rename(String name) { + return new TemplateStore(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TemplateStore rename(Name name) { + return new TemplateStore(name, null); + } + + /** + * Rename this table + */ + @Override + public TemplateStore rename(Table name) { + return new TemplateStore(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function5 + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function5 + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Tenant.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Tenant.java new file mode 100644 index 0000000..1759340 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Tenant.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TenantRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.JSON; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Tenant extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.tenant + */ + public static final Tenant TENANT = new Tenant(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TenantRecord.class; + } + + /** + * The column ehr.tenant.tenant_id. + */ + public final TableField TENANT_ID = + createField(DSL.name("tenant_id"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.tenant.tenant_name. + */ + public final TableField TENANT_NAME = + createField(DSL.name("tenant_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.tenant.tenant_properties. + */ + public final TableField TENANT_PROPERTIES = + createField(DSL.name("tenant_properties"), SQLDataType.JSON, this, ""); + + /** + * The column ehr.tenant.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.SMALLINT + .nullable(false) + .defaultValue(DSL.field(DSL.raw("ehr.next_sys_tenant()"), SQLDataType.SMALLINT)), + this, + ""); + + private Tenant(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Tenant(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.tenant table reference + */ + public Tenant(String alias) { + this(DSL.name(alias), TENANT); + } + + /** + * Create an aliased ehr.tenant table reference + */ + public Tenant(Name alias) { + this(alias, TENANT); + } + + /** + * Create a ehr.tenant table reference + */ + public Tenant() { + this(DSL.name("tenant"), null); + } + + public Tenant(Table child, ForeignKey key) { + super(child, key, TENANT); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TENANT_PKEY; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.TENANT_TENANT_ID_KEY, Keys.TENANT_TENANT_NAME_KEY); + } + + @Override + public Tenant as(String alias) { + return new Tenant(DSL.name(alias), this); + } + + @Override + public Tenant as(Name alias) { + return new Tenant(alias, this); + } + + @Override + public Tenant as(Table alias) { + return new Tenant(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Tenant rename(String name) { + return new Tenant(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Tenant rename(Name name) { + return new Tenant(name, null); + } + + /** + * Rename this table + */ + @Override + public Tenant rename(Table name) { + return new Tenant(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TerminologyProvider.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TerminologyProvider.java new file mode 100644 index 0000000..cf906a0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/TerminologyProvider.java @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TerminologyProviderRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * openEHR identified terminology provider + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TerminologyProvider extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.terminology_provider + */ + public static final TerminologyProvider TERMINOLOGY_PROVIDER = new TerminologyProvider(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TerminologyProviderRecord.class; + } + + /** + * The column ehr.terminology_provider.code. + */ + public final TableField CODE = + createField(DSL.name("code"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.terminology_provider.source. + */ + public final TableField SOURCE = + createField(DSL.name("source"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.terminology_provider.authority. + */ + public final TableField AUTHORITY = + createField(DSL.name("authority"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.terminology_provider.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private TerminologyProvider(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TerminologyProvider(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("openEHR identified terminology provider"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.terminology_provider table reference + */ + public TerminologyProvider(String alias) { + this(DSL.name(alias), TERMINOLOGY_PROVIDER); + } + + /** + * Create an aliased ehr.terminology_provider table reference + */ + public TerminologyProvider(Name alias) { + this(alias, TERMINOLOGY_PROVIDER); + } + + /** + * Create a ehr.terminology_provider table reference + */ + public TerminologyProvider() { + this(DSL.name("terminology_provider"), null); + } + + public TerminologyProvider(Table child, ForeignKey key) { + super(child, key, TERMINOLOGY_PROVIDER); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TERMINOLOGY_PROVIDER_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.TERMINOLOGY_PROVIDER__TERMINOLOGY_PROVIDER_SYS_TENANT_FKEY); + } + + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) + _tenant = new Tenant(this, Keys.TERMINOLOGY_PROVIDER__TERMINOLOGY_PROVIDER_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public TerminologyProvider as(String alias) { + return new TerminologyProvider(DSL.name(alias), this); + } + + @Override + public TerminologyProvider as(Name alias) { + return new TerminologyProvider(alias, this); + } + + @Override + public TerminologyProvider as(Table alias) { + return new TerminologyProvider(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public TerminologyProvider rename(String name) { + return new TerminologyProvider(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TerminologyProvider rename(Name name) { + return new TerminologyProvider(name, null); + } + + /** + * Rename this table + */ + @Override + public TerminologyProvider rename(Table name) { + return new TerminologyProvider(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Territory.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Territory.java new file mode 100644 index 0000000..123fe41 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Territory.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Indexes; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.TerritoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * ISO 3166-1 countries codeset + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Territory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.territory + */ + public static final Territory TERRITORY = new Territory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TerritoryRecord.class; + } + + /** + * The column ehr.territory.code. + */ + public final TableField CODE = + createField(DSL.name("code"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.territory.twoletter. + */ + public final TableField TWOLETTER = + createField(DSL.name("twoletter"), SQLDataType.CHAR(2), this, ""); + + /** + * The column ehr.territory.threeletter. + */ + public final TableField THREELETTER = + createField(DSL.name("threeletter"), SQLDataType.CHAR(3), this, ""); + + /** + * The column ehr.territory.text. + */ + public final TableField TEXT = + createField(DSL.name("text"), SQLDataType.CLOB.nullable(false), this, ""); + + private Territory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Territory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("ISO 3166-1 countries codeset"), TableOptions.table()); + } + + /** + * Create an aliased ehr.territory table reference + */ + public Territory(String alias) { + this(DSL.name(alias), TERRITORY); + } + + /** + * Create an aliased ehr.territory table reference + */ + public Territory(Name alias) { + this(alias, TERRITORY); + } + + /** + * Create a ehr.territory table reference + */ + public Territory() { + this(DSL.name("territory"), null); + } + + public Territory(Table child, ForeignKey key) { + super(child, key, TERRITORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_TERRITORY_TWOLETTER_IDX, Indexes.TERRITORY_CODE_INDEX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TERRITORY_PKEY; + } + + @Override + public Territory as(String alias) { + return new Territory(DSL.name(alias), this); + } + + @Override + public Territory as(Name alias) { + return new Territory(alias, this); + } + + @Override + public Territory as(Table alias) { + return new Territory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Territory rename(String name) { + return new Territory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Territory rename(Name name) { + return new Territory(name, null); + } + + /** + * Rename this table + */ + @Override + public Territory rename(Table name) { + return new Territory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Users.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Users.java new file mode 100644 index 0000000..4e432ed --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/Users.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.Keys; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.UsersRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function3; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class Users extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.users + */ + public static final Users USERS = new Users(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return UsersRecord.class; + } + + /** + * The column ehr.users.username. + */ + public final TableField USERNAME = + createField(DSL.name("username"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.users.party_id. + */ + public final TableField PARTY_ID = + createField(DSL.name("party_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.users.sys_tenant. + */ + public final TableField SYS_TENANT = createField( + DSL.name("sys_tenant"), + SQLDataType.SMALLINT.nullable(false).defaultValue(DSL.field(DSL.raw("1"), SQLDataType.SMALLINT)), + this, + ""); + + private Users(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Users(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.users table reference + */ + public Users(String alias) { + this(DSL.name(alias), USERS); + } + + /** + * Create an aliased ehr.users table reference + */ + public Users(Name alias) { + this(alias, USERS); + } + + /** + * Create a ehr.users table reference + */ + public Users() { + this(DSL.name("users"), null); + } + + public Users(Table child, ForeignKey key) { + super(child, key, USERS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.USERS__USERS_PARTY_ID_FKEY, Keys.USERS__USERS_SYS_TENANT_FKEY); + } + + private transient PartyIdentified _partyIdentified; + private transient Tenant _tenant; + + /** + * Get the implicit join path to the ehr.party_identified + * table. + */ + public PartyIdentified partyIdentified() { + if (_partyIdentified == null) _partyIdentified = new PartyIdentified(this, Keys.USERS__USERS_PARTY_ID_FKEY); + + return _partyIdentified; + } + + /** + * Get the implicit join path to the ehr.tenant table. + */ + public Tenant tenant() { + if (_tenant == null) _tenant = new Tenant(this, Keys.USERS__USERS_SYS_TENANT_FKEY); + + return _tenant; + } + + @Override + public Users as(String alias) { + return new Users(DSL.name(alias), this); + } + + @Override + public Users as(Name alias) { + return new Users(alias, this); + } + + @Override + public Users as(Table alias) { + return new Users(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Users rename(String name) { + return new Users(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Users rename(Name name) { + return new Users(name, null); + } + + /** + * Rename this table + */ + @Override + public Users rename(Table name) { + return new Users(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/XjsonbArrayElements.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/XjsonbArrayElements.java new file mode 100644 index 0000000..64e3134 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/XjsonbArrayElements.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables; + +import java.util.function.Function; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.records.XjsonbArrayElementsRecord; +import org.jooq.Field; +import org.jooq.Function1; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Records; +import org.jooq.Row1; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class XjsonbArrayElements extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.xjsonb_array_elements + */ + public static final XjsonbArrayElements XJSONB_ARRAY_ELEMENTS = new XjsonbArrayElements(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return XjsonbArrayElementsRecord.class; + } + + /** + * The column ehr.xjsonb_array_elements.xjsonb_array_elements. + */ + public final TableField XJSONB_ARRAY_ELEMENTS_ = + createField(DSL.name("xjsonb_array_elements"), SQLDataType.JSONB, this, ""); + + private XjsonbArrayElements(Name alias, Table aliased) { + this(alias, aliased, new Field[] {DSL.val(null, SQLDataType.JSONB)}); + } + + private XjsonbArrayElements(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + } + + /** + * Create an aliased ehr.xjsonb_array_elements table reference + */ + public XjsonbArrayElements(String alias) { + this(DSL.name(alias), XJSONB_ARRAY_ELEMENTS); + } + + /** + * Create an aliased ehr.xjsonb_array_elements table reference + */ + public XjsonbArrayElements(Name alias) { + this(alias, XJSONB_ARRAY_ELEMENTS); + } + + /** + * Create a ehr.xjsonb_array_elements table reference + */ + public XjsonbArrayElements() { + this(DSL.name("xjsonb_array_elements"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public XjsonbArrayElements as(String alias) { + return new XjsonbArrayElements(DSL.name(alias), this, parameters); + } + + @Override + public XjsonbArrayElements as(Name alias) { + return new XjsonbArrayElements(alias, this, parameters); + } + + @Override + public XjsonbArrayElements as(Table alias) { + return new XjsonbArrayElements(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public XjsonbArrayElements rename(String name) { + return new XjsonbArrayElements(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public XjsonbArrayElements rename(Name name) { + return new XjsonbArrayElements(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public XjsonbArrayElements rename(Table name) { + return new XjsonbArrayElements(name.getQualifiedName(), null, parameters); + } + + // ------------------------------------------------------------------------- + // Row1 type methods + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public XjsonbArrayElements call(JSONB entry) { + XjsonbArrayElements result = new XjsonbArrayElements( + DSL.name("xjsonb_array_elements"), null, new Field[] {DSL.val(entry, SQLDataType.JSONB)}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public XjsonbArrayElements call(Field entry) { + XjsonbArrayElements result = + new XjsonbArrayElements(DSL.name("xjsonb_array_elements"), null, new Field[] {entry}); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function1 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function1 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AccessRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AccessRecord.java new file mode 100644 index 0000000..3697de9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AccessRecord.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Access; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * defines the modality for accessing an com.ethercis.ehr (security strategy + * implementation) + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AccessRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.access.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.access.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.access.settings. + */ + public void setSettings(String value) { + set(1, value); + } + + /** + * Getter for ehr.access.settings. + */ + public String getSettings() { + return (String) get(1); + } + + /** + * Setter for ehr.access.scheme. + */ + public void setScheme(String value) { + set(2, value); + } + + /** + * Getter for ehr.access.scheme. + */ + public String getScheme() { + return (String) get(2); + } + + /** + * Setter for ehr.access.sys_tenant. + */ + public void setSysTenant(Short value) { + set(3, value); + } + + /** + * Getter for ehr.access.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Access.ACCESS.ID; + } + + @Override + public Field field2() { + return Access.ACCESS.SETTINGS; + } + + @Override + public Field field3() { + return Access.ACCESS.SCHEME; + } + + @Override + public Field field4() { + return Access.ACCESS.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getSettings(); + } + + @Override + public String component3() { + return getScheme(); + } + + @Override + public Short component4() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getSettings(); + } + + @Override + public String value3() { + return getScheme(); + } + + @Override + public Short value4() { + return getSysTenant(); + } + + @Override + public AccessRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public AccessRecord value2(String value) { + setSettings(value); + return this; + } + + @Override + public AccessRecord value3(String value) { + setScheme(value); + return this; + } + + @Override + public AccessRecord value4(Short value) { + setSysTenant(value); + return this; + } + + @Override + public AccessRecord values(UUID value1, String value2, String value3, Short value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AccessRecord + */ + public AccessRecord() { + super(Access.ACCESS); + } + + /** + * Create a detached, initialised AccessRecord + */ + public AccessRecord(UUID id, String settings, String scheme, Short sysTenant) { + super(Access.ACCESS); + + setId(id); + setSettings(settings); + setScheme(scheme); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAttestationRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAttestationRecord.java new file mode 100644 index 0000000..f9113c1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAttestationRecord.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAttestation; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteAttestationRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_attestation.audit. + */ + public void setAudit(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_attestation.audit. + */ + public UUID getAudit() { + return (UUID) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION.AUDIT; + } + + @Override + public UUID component1() { + return getAudit(); + } + + @Override + public UUID value1() { + return getAudit(); + } + + @Override + public AdminDeleteAttestationRecord value1(UUID value) { + setAudit(value); + return this; + } + + @Override + public AdminDeleteAttestationRecord values(UUID value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteAttestationRecord + */ + public AdminDeleteAttestationRecord() { + super(AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION); + } + + /** + * Create a detached, initialised AdminDeleteAttestationRecord + */ + public AdminDeleteAttestationRecord(UUID audit) { + super(AdminDeleteAttestation.ADMIN_DELETE_ATTESTATION); + + setAudit(audit); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAuditRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAuditRecord.java new file mode 100644 index 0000000..65bfc8d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteAuditRecord.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteAudit; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteAuditRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_audit.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_audit.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + /** + * Setter for ehr.admin_delete_audit.party. + */ + public void setParty(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_delete_audit.party. + */ + public UUID getParty() { + return (UUID) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteAudit.ADMIN_DELETE_AUDIT.NUM; + } + + @Override + public Field field2() { + return AdminDeleteAudit.ADMIN_DELETE_AUDIT.PARTY; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public UUID component2() { + return getParty(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public UUID value2() { + return getParty(); + } + + @Override + public AdminDeleteAuditRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteAuditRecord value2(UUID value) { + setParty(value); + return this; + } + + @Override + public AdminDeleteAuditRecord values(Integer value1, UUID value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteAuditRecord + */ + public AdminDeleteAuditRecord() { + super(AdminDeleteAudit.ADMIN_DELETE_AUDIT); + } + + /** + * Create a detached, initialised AdminDeleteAuditRecord + */ + public AdminDeleteAuditRecord(Integer num, UUID party) { + super(AdminDeleteAudit.ADMIN_DELETE_AUDIT); + + setNum(num); + setParty(party); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionHistoryRecord.java new file mode 100644 index 0000000..63b13ba --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionHistoryRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteCompositionHistory; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteCompositionHistoryRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_composition_history.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_composition_history.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteCompositionHistory.ADMIN_DELETE_COMPOSITION_HISTORY.NUM; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public AdminDeleteCompositionHistoryRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteCompositionHistoryRecord values(Integer value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteCompositionHistoryRecord + */ + public AdminDeleteCompositionHistoryRecord() { + super(AdminDeleteCompositionHistory.ADMIN_DELETE_COMPOSITION_HISTORY); + } + + /** + * Create a detached, initialised AdminDeleteCompositionHistoryRecord + */ + public AdminDeleteCompositionHistoryRecord(Integer num) { + super(AdminDeleteCompositionHistory.ADMIN_DELETE_COMPOSITION_HISTORY); + + setNum(num); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionRecord.java new file mode 100644 index 0000000..2ab9225 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteCompositionRecord.java @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteComposition; +import org.jooq.Field; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteCompositionRecord extends TableRecordImpl + implements Record5 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_composition.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_composition.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + /** + * Setter for ehr.admin_delete_composition.contribution. + */ + public void setContribution(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_delete_composition.contribution. + */ + public UUID getContribution() { + return (UUID) get(1); + } + + /** + * Setter for ehr.admin_delete_composition.party. + */ + public void setParty(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.admin_delete_composition.party. + */ + public UUID getParty() { + return (UUID) get(2); + } + + /** + * Setter for ehr.admin_delete_composition.audit. + */ + public void setAudit(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.admin_delete_composition.audit. + */ + public UUID getAudit() { + return (UUID) get(3); + } + + /** + * Setter for ehr.admin_delete_composition.attestation. + */ + public void setAttestation(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.admin_delete_composition.attestation. + */ + public UUID getAttestation() { + return (UUID) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.NUM; + } + + @Override + public Field field2() { + return AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.CONTRIBUTION; + } + + @Override + public Field field3() { + return AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.PARTY; + } + + @Override + public Field field4() { + return AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.AUDIT; + } + + @Override + public Field field5() { + return AdminDeleteComposition.ADMIN_DELETE_COMPOSITION.ATTESTATION; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public UUID component2() { + return getContribution(); + } + + @Override + public UUID component3() { + return getParty(); + } + + @Override + public UUID component4() { + return getAudit(); + } + + @Override + public UUID component5() { + return getAttestation(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public UUID value2() { + return getContribution(); + } + + @Override + public UUID value3() { + return getParty(); + } + + @Override + public UUID value4() { + return getAudit(); + } + + @Override + public UUID value5() { + return getAttestation(); + } + + @Override + public AdminDeleteCompositionRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteCompositionRecord value2(UUID value) { + setContribution(value); + return this; + } + + @Override + public AdminDeleteCompositionRecord value3(UUID value) { + setParty(value); + return this; + } + + @Override + public AdminDeleteCompositionRecord value4(UUID value) { + setAudit(value); + return this; + } + + @Override + public AdminDeleteCompositionRecord value5(UUID value) { + setAttestation(value); + return this; + } + + @Override + public AdminDeleteCompositionRecord values(Integer value1, UUID value2, UUID value3, UUID value4, UUID value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteCompositionRecord + */ + public AdminDeleteCompositionRecord() { + super(AdminDeleteComposition.ADMIN_DELETE_COMPOSITION); + } + + /** + * Create a detached, initialised AdminDeleteCompositionRecord + */ + public AdminDeleteCompositionRecord(Integer num, UUID contribution, UUID party, UUID audit, UUID attestation) { + super(AdminDeleteComposition.ADMIN_DELETE_COMPOSITION); + + setNum(num); + setContribution(contribution); + setParty(party); + setAudit(audit); + setAttestation(attestation); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteContributionRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteContributionRecord.java new file mode 100644 index 0000000..2861806 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteContributionRecord.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteContribution; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteContributionRecord extends TableRecordImpl + implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_contribution.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_contribution.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + /** + * Setter for ehr.admin_delete_contribution.audit. + */ + public void setAudit(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_delete_contribution.audit. + */ + public UUID getAudit() { + return (UUID) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.NUM; + } + + @Override + public Field field2() { + return AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION.AUDIT; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public UUID component2() { + return getAudit(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public UUID value2() { + return getAudit(); + } + + @Override + public AdminDeleteContributionRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteContributionRecord value2(UUID value) { + setAudit(value); + return this; + } + + @Override + public AdminDeleteContributionRecord values(Integer value1, UUID value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteContributionRecord + */ + public AdminDeleteContributionRecord() { + super(AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION); + } + + /** + * Create a detached, initialised AdminDeleteContributionRecord + */ + public AdminDeleteContributionRecord(Integer num, UUID audit) { + super(AdminDeleteContribution.ADMIN_DELETE_CONTRIBUTION); + + setNum(num); + setAudit(audit); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrFullRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrFullRecord.java new file mode 100644 index 0000000..84ae367 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrFullRecord.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrFull; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEhrFullRecord extends TableRecordImpl implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_ehr_full.deleted. + */ + public void setDeleted(Boolean value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_ehr_full.deleted. + */ + public Boolean getDeleted() { + return (Boolean) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL.DELETED; + } + + @Override + public Boolean component1() { + return getDeleted(); + } + + @Override + public Boolean value1() { + return getDeleted(); + } + + @Override + public AdminDeleteEhrFullRecord value1(Boolean value) { + setDeleted(value); + return this; + } + + @Override + public AdminDeleteEhrFullRecord values(Boolean value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteEhrFullRecord + */ + public AdminDeleteEhrFullRecord() { + super(AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL); + } + + /** + * Create a detached, initialised AdminDeleteEhrFullRecord + */ + public AdminDeleteEhrFullRecord(Boolean deleted) { + super(AdminDeleteEhrFull.ADMIN_DELETE_EHR_FULL); + + setDeleted(deleted); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrHistoryRecord.java new file mode 100644 index 0000000..f3e3865 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrHistoryRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhrHistory; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEhrHistoryRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_ehr_history.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_ehr_history.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY.NUM; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public AdminDeleteEhrHistoryRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteEhrHistoryRecord values(Integer value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteEhrHistoryRecord + */ + public AdminDeleteEhrHistoryRecord() { + super(AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY); + } + + /** + * Create a detached, initialised AdminDeleteEhrHistoryRecord + */ + public AdminDeleteEhrHistoryRecord(Integer num) { + super(AdminDeleteEhrHistory.ADMIN_DELETE_EHR_HISTORY); + + setNum(num); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrRecord.java new file mode 100644 index 0000000..5a43d84 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEhrRecord.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEhr; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEhrRecord extends TableRecordImpl + implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_ehr.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_ehr.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + /** + * Setter for ehr.admin_delete_ehr.status_audit. + */ + public void setStatusAudit(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_delete_ehr.status_audit. + */ + public UUID getStatusAudit() { + return (UUID) get(1); + } + + /** + * Setter for ehr.admin_delete_ehr.status_party. + */ + public void setStatusParty(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.admin_delete_ehr.status_party. + */ + public UUID getStatusParty() { + return (UUID) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteEhr.ADMIN_DELETE_EHR.NUM; + } + + @Override + public Field field2() { + return AdminDeleteEhr.ADMIN_DELETE_EHR.STATUS_AUDIT; + } + + @Override + public Field field3() { + return AdminDeleteEhr.ADMIN_DELETE_EHR.STATUS_PARTY; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public UUID component2() { + return getStatusAudit(); + } + + @Override + public UUID component3() { + return getStatusParty(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public UUID value2() { + return getStatusAudit(); + } + + @Override + public UUID value3() { + return getStatusParty(); + } + + @Override + public AdminDeleteEhrRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteEhrRecord value2(UUID value) { + setStatusAudit(value); + return this; + } + + @Override + public AdminDeleteEhrRecord value3(UUID value) { + setStatusParty(value); + return this; + } + + @Override + public AdminDeleteEhrRecord values(Integer value1, UUID value2, UUID value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteEhrRecord + */ + public AdminDeleteEhrRecord() { + super(AdminDeleteEhr.ADMIN_DELETE_EHR); + } + + /** + * Create a detached, initialised AdminDeleteEhrRecord + */ + public AdminDeleteEhrRecord(Integer num, UUID statusAudit, UUID statusParty) { + super(AdminDeleteEhr.ADMIN_DELETE_EHR); + + setNum(num); + setStatusAudit(statusAudit); + setStatusParty(statusParty); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEventContextForCompoRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEventContextForCompoRecord.java new file mode 100644 index 0000000..d35f228 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteEventContextForCompoRecord.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteEventContextForCompo; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteEventContextForCompoRecord extends TableRecordImpl + implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_event_context_for_compo.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_event_context_for_compo.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + /** + * Setter for ehr.admin_delete_event_context_for_compo.party. + */ + public void setParty(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_delete_event_context_for_compo.party. + */ + public UUID getParty() { + return (UUID) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO.NUM; + } + + @Override + public Field field2() { + return AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO.PARTY; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public UUID component2() { + return getParty(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public UUID value2() { + return getParty(); + } + + @Override + public AdminDeleteEventContextForCompoRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteEventContextForCompoRecord value2(UUID value) { + setParty(value); + return this; + } + + @Override + public AdminDeleteEventContextForCompoRecord values(Integer value1, UUID value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteEventContextForCompoRecord + */ + public AdminDeleteEventContextForCompoRecord() { + super(AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO); + } + + /** + * Create a detached, initialised AdminDeleteEventContextForCompoRecord + */ + public AdminDeleteEventContextForCompoRecord(Integer num, UUID party) { + super(AdminDeleteEventContextForCompo.ADMIN_DELETE_EVENT_CONTEXT_FOR_COMPO); + + setNum(num); + setParty(party); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusHistoryRecord.java new file mode 100644 index 0000000..9777674 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusHistoryRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatusHistory; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteStatusHistoryRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_status_history.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_status_history.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY.NUM; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public AdminDeleteStatusHistoryRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteStatusHistoryRecord values(Integer value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteStatusHistoryRecord + */ + public AdminDeleteStatusHistoryRecord() { + super(AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY); + } + + /** + * Create a detached, initialised AdminDeleteStatusHistoryRecord + */ + public AdminDeleteStatusHistoryRecord(Integer num) { + super(AdminDeleteStatusHistory.ADMIN_DELETE_STATUS_HISTORY); + + setNum(num); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusRecord.java new file mode 100644 index 0000000..3d49f08 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteStatusRecord.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteStatus; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteStatusRecord extends TableRecordImpl + implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_status.num. + */ + public void setNum(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_status.num. + */ + public Integer getNum() { + return (Integer) get(0); + } + + /** + * Setter for ehr.admin_delete_status.status_audit. + */ + public void setStatusAudit(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_delete_status.status_audit. + */ + public UUID getStatusAudit() { + return (UUID) get(1); + } + + /** + * Setter for ehr.admin_delete_status.status_party. + */ + public void setStatusParty(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.admin_delete_status.status_party. + */ + public UUID getStatusParty() { + return (UUID) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteStatus.ADMIN_DELETE_STATUS.NUM; + } + + @Override + public Field field2() { + return AdminDeleteStatus.ADMIN_DELETE_STATUS.STATUS_AUDIT; + } + + @Override + public Field field3() { + return AdminDeleteStatus.ADMIN_DELETE_STATUS.STATUS_PARTY; + } + + @Override + public Integer component1() { + return getNum(); + } + + @Override + public UUID component2() { + return getStatusAudit(); + } + + @Override + public UUID component3() { + return getStatusParty(); + } + + @Override + public Integer value1() { + return getNum(); + } + + @Override + public UUID value2() { + return getStatusAudit(); + } + + @Override + public UUID value3() { + return getStatusParty(); + } + + @Override + public AdminDeleteStatusRecord value1(Integer value) { + setNum(value); + return this; + } + + @Override + public AdminDeleteStatusRecord value2(UUID value) { + setStatusAudit(value); + return this; + } + + @Override + public AdminDeleteStatusRecord value3(UUID value) { + setStatusParty(value); + return this; + } + + @Override + public AdminDeleteStatusRecord values(Integer value1, UUID value2, UUID value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteStatusRecord + */ + public AdminDeleteStatusRecord() { + super(AdminDeleteStatus.ADMIN_DELETE_STATUS); + } + + /** + * Create a detached, initialised AdminDeleteStatusRecord + */ + public AdminDeleteStatusRecord(Integer num, UUID statusAudit, UUID statusParty) { + super(AdminDeleteStatus.ADMIN_DELETE_STATUS); + + setNum(num); + setStatusAudit(statusAudit); + setStatusParty(statusParty); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteTenantFullRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteTenantFullRecord.java new file mode 100644 index 0000000..a700c05 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminDeleteTenantFullRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminDeleteTenantFull; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminDeleteTenantFullRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_delete_tenant_full.deleted. + */ + public void setDeleted(Boolean value) { + set(0, value); + } + + /** + * Getter for ehr.admin_delete_tenant_full.deleted. + */ + public Boolean getDeleted() { + return (Boolean) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL.DELETED; + } + + @Override + public Boolean component1() { + return getDeleted(); + } + + @Override + public Boolean value1() { + return getDeleted(); + } + + @Override + public AdminDeleteTenantFullRecord value1(Boolean value) { + setDeleted(value); + return this; + } + + @Override + public AdminDeleteTenantFullRecord values(Boolean value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminDeleteTenantFullRecord + */ + public AdminDeleteTenantFullRecord() { + super(AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL); + } + + /** + * Create a detached, initialised AdminDeleteTenantFullRecord + */ + public AdminDeleteTenantFullRecord(Boolean deleted) { + super(AdminDeleteTenantFull.ADMIN_DELETE_TENANT_FULL); + + setDeleted(deleted); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsForContribRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsForContribRecord.java new file mode 100644 index 0000000..9820e3d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsForContribRecord.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositionsForContrib; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedCompositionsForContribRecord + extends TableRecordImpl implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for + * ehr.admin_get_linked_compositions_for_contrib.composition. + */ + public void setComposition(UUID value) { + set(0, value); + } + + /** + * Getter for + * ehr.admin_get_linked_compositions_for_contrib.composition. + */ + public UUID getComposition() { + return (UUID) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminGetLinkedCompositionsForContrib.ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB.COMPOSITION; + } + + @Override + public UUID component1() { + return getComposition(); + } + + @Override + public UUID value1() { + return getComposition(); + } + + @Override + public AdminGetLinkedCompositionsForContribRecord value1(UUID value) { + setComposition(value); + return this; + } + + @Override + public AdminGetLinkedCompositionsForContribRecord values(UUID value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminGetLinkedCompositionsForContribRecord + */ + public AdminGetLinkedCompositionsForContribRecord() { + super(AdminGetLinkedCompositionsForContrib.ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB); + } + + /** + * Create a detached, initialised AdminGetLinkedCompositionsForContribRecord + */ + public AdminGetLinkedCompositionsForContribRecord(UUID composition) { + super(AdminGetLinkedCompositionsForContrib.ADMIN_GET_LINKED_COMPOSITIONS_FOR_CONTRIB); + + setComposition(composition); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsRecord.java new file mode 100644 index 0000000..00b10f6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedCompositionsRecord.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedCompositions; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedCompositionsRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_get_linked_compositions.composition. + */ + public void setComposition(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.admin_get_linked_compositions.composition. + */ + public UUID getComposition() { + return (UUID) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS.COMPOSITION; + } + + @Override + public UUID component1() { + return getComposition(); + } + + @Override + public UUID value1() { + return getComposition(); + } + + @Override + public AdminGetLinkedCompositionsRecord value1(UUID value) { + setComposition(value); + return this; + } + + @Override + public AdminGetLinkedCompositionsRecord values(UUID value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminGetLinkedCompositionsRecord + */ + public AdminGetLinkedCompositionsRecord() { + super(AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS); + } + + /** + * Create a detached, initialised AdminGetLinkedCompositionsRecord + */ + public AdminGetLinkedCompositionsRecord(UUID composition) { + super(AdminGetLinkedCompositions.ADMIN_GET_LINKED_COMPOSITIONS); + + setComposition(composition); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedContributionsRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedContributionsRecord.java new file mode 100644 index 0000000..905fb93 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedContributionsRecord.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedContributions; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedContributionsRecord extends TableRecordImpl + implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_get_linked_contributions.contribution. + */ + public void setContribution(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.admin_get_linked_contributions.contribution. + */ + public UUID getContribution() { + return (UUID) get(0); + } + + /** + * Setter for ehr.admin_get_linked_contributions.audit. + */ + public void setAudit(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.admin_get_linked_contributions.audit. + */ + public UUID getAudit() { + return (UUID) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS.CONTRIBUTION; + } + + @Override + public Field field2() { + return AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS.AUDIT; + } + + @Override + public UUID component1() { + return getContribution(); + } + + @Override + public UUID component2() { + return getAudit(); + } + + @Override + public UUID value1() { + return getContribution(); + } + + @Override + public UUID value2() { + return getAudit(); + } + + @Override + public AdminGetLinkedContributionsRecord value1(UUID value) { + setContribution(value); + return this; + } + + @Override + public AdminGetLinkedContributionsRecord value2(UUID value) { + setAudit(value); + return this; + } + + @Override + public AdminGetLinkedContributionsRecord values(UUID value1, UUID value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminGetLinkedContributionsRecord + */ + public AdminGetLinkedContributionsRecord() { + super(AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS); + } + + /** + * Create a detached, initialised AdminGetLinkedContributionsRecord + */ + public AdminGetLinkedContributionsRecord(UUID contribution, UUID audit) { + super(AdminGetLinkedContributions.ADMIN_GET_LINKED_CONTRIBUTIONS); + + setContribution(contribution); + setAudit(audit); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedStatusForContribRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedStatusForContribRecord.java new file mode 100644 index 0000000..2f6d7e5 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetLinkedStatusForContribRecord.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetLinkedStatusForContrib; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetLinkedStatusForContribRecord extends TableRecordImpl + implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_get_linked_status_for_contrib.status. + */ + public void setStatus(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.admin_get_linked_status_for_contrib.status. + */ + public UUID getStatus() { + return (UUID) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminGetLinkedStatusForContrib.ADMIN_GET_LINKED_STATUS_FOR_CONTRIB.STATUS; + } + + @Override + public UUID component1() { + return getStatus(); + } + + @Override + public UUID value1() { + return getStatus(); + } + + @Override + public AdminGetLinkedStatusForContribRecord value1(UUID value) { + setStatus(value); + return this; + } + + @Override + public AdminGetLinkedStatusForContribRecord values(UUID value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminGetLinkedStatusForContribRecord + */ + public AdminGetLinkedStatusForContribRecord() { + super(AdminGetLinkedStatusForContrib.ADMIN_GET_LINKED_STATUS_FOR_CONTRIB); + } + + /** + * Create a detached, initialised AdminGetLinkedStatusForContribRecord + */ + public AdminGetLinkedStatusForContribRecord(UUID status) { + super(AdminGetLinkedStatusForContrib.ADMIN_GET_LINKED_STATUS_FOR_CONTRIB); + + setStatus(status); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetTemplateUsageRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetTemplateUsageRecord.java new file mode 100644 index 0000000..ad8384e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AdminGetTemplateUsageRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AdminGetTemplateUsage; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AdminGetTemplateUsageRecord extends TableRecordImpl implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.admin_get_template_usage.composition_id. + */ + public void setCompositionId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.admin_get_template_usage.composition_id. + */ + public UUID getCompositionId() { + return (UUID) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE.COMPOSITION_ID; + } + + @Override + public UUID component1() { + return getCompositionId(); + } + + @Override + public UUID value1() { + return getCompositionId(); + } + + @Override + public AdminGetTemplateUsageRecord value1(UUID value) { + setCompositionId(value); + return this; + } + + @Override + public AdminGetTemplateUsageRecord values(UUID value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminGetTemplateUsageRecord + */ + public AdminGetTemplateUsageRecord() { + super(AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE); + } + + /** + * Create a detached, initialised AdminGetTemplateUsageRecord + */ + public AdminGetTemplateUsageRecord(UUID compositionId) { + super(AdminGetTemplateUsage.ADMIN_GET_TEMPLATE_USAGE); + + setCompositionId(compositionId); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRecord.java new file mode 100644 index 0000000..9c54ca4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRecord.java @@ -0,0 +1,345 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Attestation; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AttestationRecord extends UpdatableRecordImpl + implements Record7 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.attestation.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.attestation.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.attestation.proof. + */ + public void setProof(String value) { + set(1, value); + } + + /** + * Getter for ehr.attestation.proof. + */ + public String getProof() { + return (String) get(1); + } + + /** + * Setter for ehr.attestation.reason. + */ + public void setReason(String value) { + set(2, value); + } + + /** + * Getter for ehr.attestation.reason. + */ + public String getReason() { + return (String) get(2); + } + + /** + * Setter for ehr.attestation.is_pending. + */ + public void setIsPending(Boolean value) { + set(3, value); + } + + /** + * Getter for ehr.attestation.is_pending. + */ + public Boolean getIsPending() { + return (Boolean) get(3); + } + + /** + * Setter for ehr.attestation.has_audit. + */ + public void setHasAudit(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.attestation.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(4); + } + + /** + * Setter for ehr.attestation.reference. + */ + public void setReference(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.attestation.reference. + */ + public UUID getReference() { + return (UUID) get(5); + } + + /** + * Setter for ehr.attestation.sys_tenant. + */ + public void setSysTenant(Short value) { + set(6, value); + } + + /** + * Getter for ehr.attestation.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return Attestation.ATTESTATION.ID; + } + + @Override + public Field field2() { + return Attestation.ATTESTATION.PROOF; + } + + @Override + public Field field3() { + return Attestation.ATTESTATION.REASON; + } + + @Override + public Field field4() { + return Attestation.ATTESTATION.IS_PENDING; + } + + @Override + public Field field5() { + return Attestation.ATTESTATION.HAS_AUDIT; + } + + @Override + public Field field6() { + return Attestation.ATTESTATION.REFERENCE; + } + + @Override + public Field field7() { + return Attestation.ATTESTATION.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getProof(); + } + + @Override + public String component3() { + return getReason(); + } + + @Override + public Boolean component4() { + return getIsPending(); + } + + @Override + public UUID component5() { + return getHasAudit(); + } + + @Override + public UUID component6() { + return getReference(); + } + + @Override + public Short component7() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getProof(); + } + + @Override + public String value3() { + return getReason(); + } + + @Override + public Boolean value4() { + return getIsPending(); + } + + @Override + public UUID value5() { + return getHasAudit(); + } + + @Override + public UUID value6() { + return getReference(); + } + + @Override + public Short value7() { + return getSysTenant(); + } + + @Override + public AttestationRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public AttestationRecord value2(String value) { + setProof(value); + return this; + } + + @Override + public AttestationRecord value3(String value) { + setReason(value); + return this; + } + + @Override + public AttestationRecord value4(Boolean value) { + setIsPending(value); + return this; + } + + @Override + public AttestationRecord value5(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public AttestationRecord value6(UUID value) { + setReference(value); + return this; + } + + @Override + public AttestationRecord value7(Short value) { + setSysTenant(value); + return this; + } + + @Override + public AttestationRecord values( + UUID value1, String value2, String value3, Boolean value4, UUID value5, UUID value6, Short value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AttestationRecord + */ + public AttestationRecord() { + super(Attestation.ATTESTATION); + } + + /** + * Create a detached, initialised AttestationRecord + */ + public AttestationRecord( + UUID id, String proof, String reason, Boolean isPending, UUID hasAudit, UUID reference, Short sysTenant) { + super(Attestation.ATTESTATION); + + setId(id); + setProof(proof); + setReason(reason); + setIsPending(isPending); + setHasAudit(hasAudit); + setReference(reference); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRefRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRefRecord.java new file mode 100644 index 0000000..a6f3261 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestationRefRecord.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestationRef; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AttestationRefRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.attestation_ref.ref. + */ + public void setRef(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.attestation_ref.ref. + */ + public UUID getRef() { + return (UUID) get(0); + } + + /** + * Setter for ehr.attestation_ref.sys_tenant. + */ + public void setSysTenant(Short value) { + set(1, value); + } + + /** + * Getter for ehr.attestation_ref.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return AttestationRef.ATTESTATION_REF.REF; + } + + @Override + public Field field2() { + return AttestationRef.ATTESTATION_REF.SYS_TENANT; + } + + @Override + public UUID component1() { + return getRef(); + } + + @Override + public Short component2() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getRef(); + } + + @Override + public Short value2() { + return getSysTenant(); + } + + @Override + public AttestationRefRecord value1(UUID value) { + setRef(value); + return this; + } + + @Override + public AttestationRefRecord value2(Short value) { + setSysTenant(value); + return this; + } + + @Override + public AttestationRefRecord values(UUID value1, Short value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AttestationRefRecord + */ + public AttestationRefRecord() { + super(AttestationRef.ATTESTATION_REF); + } + + /** + * Create a detached, initialised AttestationRefRecord + */ + public AttestationRefRecord(UUID ref, Short sysTenant) { + super(AttestationRef.ATTESTATION_REF); + + setRef(ref); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestedViewRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestedViewRecord.java new file mode 100644 index 0000000..4ec3b1c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AttestedViewRecord.java @@ -0,0 +1,513 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AttestedView; +import org.jooq.Field; +import org.jooq.Record11; +import org.jooq.Record2; +import org.jooq.Row11; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AttestedViewRecord extends UpdatableRecordImpl + implements Record11 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.attested_view.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.attested_view.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.attested_view.attestation_id. + */ + public void setAttestationId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.attested_view.attestation_id. + */ + public UUID getAttestationId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.attested_view.alternate_text. + */ + public void setAlternateText(String value) { + set(2, value); + } + + /** + * Getter for ehr.attested_view.alternate_text. + */ + public String getAlternateText() { + return (String) get(2); + } + + /** + * Setter for ehr.attested_view.compression_algorithm. + */ + public void setCompressionAlgorithm(String value) { + set(3, value); + } + + /** + * Getter for ehr.attested_view.compression_algorithm. + */ + public String getCompressionAlgorithm() { + return (String) get(3); + } + + /** + * Setter for ehr.attested_view.media_type. + */ + public void setMediaType(String value) { + set(4, value); + } + + /** + * Getter for ehr.attested_view.media_type. + */ + public String getMediaType() { + return (String) get(4); + } + + /** + * Setter for ehr.attested_view.data. + */ + public void setData(byte[] value) { + set(5, value); + } + + /** + * Getter for ehr.attested_view.data. + */ + public byte[] getData() { + return (byte[]) get(5); + } + + /** + * Setter for ehr.attested_view.integrity_check. + */ + public void setIntegrityCheck(byte[] value) { + set(6, value); + } + + /** + * Getter for ehr.attested_view.integrity_check. + */ + public byte[] getIntegrityCheck() { + return (byte[]) get(6); + } + + /** + * Setter for ehr.attested_view.integrity_check_algorithm. + */ + public void setIntegrityCheckAlgorithm(String value) { + set(7, value); + } + + /** + * Getter for ehr.attested_view.integrity_check_algorithm. + */ + public String getIntegrityCheckAlgorithm() { + return (String) get(7); + } + + /** + * Setter for ehr.attested_view.thumbnail. + */ + public void setThumbnail(UUID value) { + set(8, value); + } + + /** + * Getter for ehr.attested_view.thumbnail. + */ + public UUID getThumbnail() { + return (UUID) get(8); + } + + /** + * Setter for ehr.attested_view.uri. + */ + public void setUri(String value) { + set(9, value); + } + + /** + * Getter for ehr.attested_view.uri. + */ + public String getUri() { + return (String) get(9); + } + + /** + * Setter for ehr.attested_view.sys_tenant. + */ + public void setSysTenant(Short value) { + set(10, value); + } + + /** + * Getter for ehr.attested_view.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(10); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return AttestedView.ATTESTED_VIEW.ID; + } + + @Override + public Field field2() { + return AttestedView.ATTESTED_VIEW.ATTESTATION_ID; + } + + @Override + public Field field3() { + return AttestedView.ATTESTED_VIEW.ALTERNATE_TEXT; + } + + @Override + public Field field4() { + return AttestedView.ATTESTED_VIEW.COMPRESSION_ALGORITHM; + } + + @Override + public Field field5() { + return AttestedView.ATTESTED_VIEW.MEDIA_TYPE; + } + + @Override + public Field field6() { + return AttestedView.ATTESTED_VIEW.DATA; + } + + @Override + public Field field7() { + return AttestedView.ATTESTED_VIEW.INTEGRITY_CHECK; + } + + @Override + public Field field8() { + return AttestedView.ATTESTED_VIEW.INTEGRITY_CHECK_ALGORITHM; + } + + @Override + public Field field9() { + return AttestedView.ATTESTED_VIEW.THUMBNAIL; + } + + @Override + public Field field10() { + return AttestedView.ATTESTED_VIEW.URI; + } + + @Override + public Field field11() { + return AttestedView.ATTESTED_VIEW.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getAttestationId(); + } + + @Override + public String component3() { + return getAlternateText(); + } + + @Override + public String component4() { + return getCompressionAlgorithm(); + } + + @Override + public String component5() { + return getMediaType(); + } + + @Override + public byte[] component6() { + return getData(); + } + + @Override + public byte[] component7() { + return getIntegrityCheck(); + } + + @Override + public String component8() { + return getIntegrityCheckAlgorithm(); + } + + @Override + public UUID component9() { + return getThumbnail(); + } + + @Override + public String component10() { + return getUri(); + } + + @Override + public Short component11() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getAttestationId(); + } + + @Override + public String value3() { + return getAlternateText(); + } + + @Override + public String value4() { + return getCompressionAlgorithm(); + } + + @Override + public String value5() { + return getMediaType(); + } + + @Override + public byte[] value6() { + return getData(); + } + + @Override + public byte[] value7() { + return getIntegrityCheck(); + } + + @Override + public String value8() { + return getIntegrityCheckAlgorithm(); + } + + @Override + public UUID value9() { + return getThumbnail(); + } + + @Override + public String value10() { + return getUri(); + } + + @Override + public Short value11() { + return getSysTenant(); + } + + @Override + public AttestedViewRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public AttestedViewRecord value2(UUID value) { + setAttestationId(value); + return this; + } + + @Override + public AttestedViewRecord value3(String value) { + setAlternateText(value); + return this; + } + + @Override + public AttestedViewRecord value4(String value) { + setCompressionAlgorithm(value); + return this; + } + + @Override + public AttestedViewRecord value5(String value) { + setMediaType(value); + return this; + } + + @Override + public AttestedViewRecord value6(byte[] value) { + setData(value); + return this; + } + + @Override + public AttestedViewRecord value7(byte[] value) { + setIntegrityCheck(value); + return this; + } + + @Override + public AttestedViewRecord value8(String value) { + setIntegrityCheckAlgorithm(value); + return this; + } + + @Override + public AttestedViewRecord value9(UUID value) { + setThumbnail(value); + return this; + } + + @Override + public AttestedViewRecord value10(String value) { + setUri(value); + return this; + } + + @Override + public AttestedViewRecord value11(Short value) { + setSysTenant(value); + return this; + } + + @Override + public AttestedViewRecord values( + UUID value1, + UUID value2, + String value3, + String value4, + String value5, + byte[] value6, + byte[] value7, + String value8, + UUID value9, + String value10, + Short value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AttestedViewRecord + */ + public AttestedViewRecord() { + super(AttestedView.ATTESTED_VIEW); + } + + /** + * Create a detached, initialised AttestedViewRecord + */ + public AttestedViewRecord( + UUID id, + UUID attestationId, + String alternateText, + String compressionAlgorithm, + String mediaType, + byte[] data, + byte[] integrityCheck, + String integrityCheckAlgorithm, + UUID thumbnail, + String uri, + Short sysTenant) { + super(AttestedView.ATTESTED_VIEW); + + setId(id); + setAttestationId(attestationId); + setAlternateText(alternateText); + setCompressionAlgorithm(compressionAlgorithm); + setMediaType(mediaType); + setData(data); + setIntegrityCheck(integrityCheck); + setIntegrityCheckAlgorithm(integrityCheckAlgorithm); + setThumbnail(thumbnail); + setUri(uri); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AuditDetailsRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AuditDetailsRecord.java new file mode 100644 index 0000000..49c07f4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/AuditDetailsRecord.java @@ -0,0 +1,398 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionChangeType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.AuditDetails; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record8; +import org.jooq.Row8; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class AuditDetailsRecord extends UpdatableRecordImpl + implements Record8 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.audit_details.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.audit_details.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.audit_details.system_id. + */ + public void setSystemId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.audit_details.system_id. + */ + public UUID getSystemId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.audit_details.committer. + */ + public void setCommitter(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.audit_details.committer. + */ + public UUID getCommitter() { + return (UUID) get(2); + } + + /** + * Setter for ehr.audit_details.time_committed. + */ + public void setTimeCommitted(Timestamp value) { + set(3, value); + } + + /** + * Getter for ehr.audit_details.time_committed. + */ + public Timestamp getTimeCommitted() { + return (Timestamp) get(3); + } + + /** + * Setter for ehr.audit_details.time_committed_tzid. + */ + public void setTimeCommittedTzid(String value) { + set(4, value); + } + + /** + * Getter for ehr.audit_details.time_committed_tzid. + */ + public String getTimeCommittedTzid() { + return (String) get(4); + } + + /** + * Setter for ehr.audit_details.change_type. + */ + public void setChangeType(ContributionChangeType value) { + set(5, value); + } + + /** + * Getter for ehr.audit_details.change_type. + */ + public ContributionChangeType getChangeType() { + return (ContributionChangeType) get(5); + } + + /** + * Setter for ehr.audit_details.description. + */ + public void setDescription(String value) { + set(6, value); + } + + /** + * Getter for ehr.audit_details.description. + */ + public String getDescription() { + return (String) get(6); + } + + /** + * Setter for ehr.audit_details.sys_tenant. + */ + public void setSysTenant(Short value) { + set(7, value); + } + + /** + * Getter for ehr.audit_details.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return AuditDetails.AUDIT_DETAILS.ID; + } + + @Override + public Field field2() { + return AuditDetails.AUDIT_DETAILS.SYSTEM_ID; + } + + @Override + public Field field3() { + return AuditDetails.AUDIT_DETAILS.COMMITTER; + } + + @Override + public Field field4() { + return AuditDetails.AUDIT_DETAILS.TIME_COMMITTED; + } + + @Override + public Field field5() { + return AuditDetails.AUDIT_DETAILS.TIME_COMMITTED_TZID; + } + + @Override + public Field field6() { + return AuditDetails.AUDIT_DETAILS.CHANGE_TYPE; + } + + @Override + public Field field7() { + return AuditDetails.AUDIT_DETAILS.DESCRIPTION; + } + + @Override + public Field field8() { + return AuditDetails.AUDIT_DETAILS.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getSystemId(); + } + + @Override + public UUID component3() { + return getCommitter(); + } + + @Override + public Timestamp component4() { + return getTimeCommitted(); + } + + @Override + public String component5() { + return getTimeCommittedTzid(); + } + + @Override + public ContributionChangeType component6() { + return getChangeType(); + } + + @Override + public String component7() { + return getDescription(); + } + + @Override + public Short component8() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getSystemId(); + } + + @Override + public UUID value3() { + return getCommitter(); + } + + @Override + public Timestamp value4() { + return getTimeCommitted(); + } + + @Override + public String value5() { + return getTimeCommittedTzid(); + } + + @Override + public ContributionChangeType value6() { + return getChangeType(); + } + + @Override + public String value7() { + return getDescription(); + } + + @Override + public Short value8() { + return getSysTenant(); + } + + @Override + public AuditDetailsRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public AuditDetailsRecord value2(UUID value) { + setSystemId(value); + return this; + } + + @Override + public AuditDetailsRecord value3(UUID value) { + setCommitter(value); + return this; + } + + @Override + public AuditDetailsRecord value4(Timestamp value) { + setTimeCommitted(value); + return this; + } + + @Override + public AuditDetailsRecord value5(String value) { + setTimeCommittedTzid(value); + return this; + } + + @Override + public AuditDetailsRecord value6(ContributionChangeType value) { + setChangeType(value); + return this; + } + + @Override + public AuditDetailsRecord value7(String value) { + setDescription(value); + return this; + } + + @Override + public AuditDetailsRecord value8(Short value) { + setSysTenant(value); + return this; + } + + @Override + public AuditDetailsRecord values( + UUID value1, + UUID value2, + UUID value3, + Timestamp value4, + String value5, + ContributionChangeType value6, + String value7, + Short value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AuditDetailsRecord + */ + public AuditDetailsRecord() { + super(AuditDetails.AUDIT_DETAILS); + } + + /** + * Create a detached, initialised AuditDetailsRecord + */ + public AuditDetailsRecord( + UUID id, + UUID systemId, + UUID committer, + Timestamp timeCommitted, + String timeCommittedTzid, + ContributionChangeType changeType, + String description, + Short sysTenant) { + super(AuditDetails.AUDIT_DETAILS); + + setId(id); + setSystemId(systemId); + setCommitter(committer); + setTimeCommitted(timeCommitted); + setTimeCommittedTzid(timeCommittedTzid); + setChangeType(changeType); + setDescription(description); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompExpandRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompExpandRecord.java new file mode 100644 index 0000000..8e972ac --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompExpandRecord.java @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompExpand; +import org.jooq.JSONB; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompExpandRecord extends TableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.comp_expand.ehr_id. + */ + public void setEhrId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.comp_expand.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.comp_expand.subject_externalref_id_value. + */ + public void setSubjectExternalrefIdValue(String value) { + set(1, value); + } + + /** + * Getter for ehr.comp_expand.subject_externalref_id_value. + */ + public String getSubjectExternalrefIdValue() { + return (String) get(1); + } + + /** + * Setter for ehr.comp_expand.subject_externalref_id_namespace. + */ + public void setSubjectExternalrefIdNamespace(String value) { + set(2, value); + } + + /** + * Getter for ehr.comp_expand.subject_externalref_id_namespace. + */ + public String getSubjectExternalrefIdNamespace() { + return (String) get(2); + } + + /** + * Setter for ehr.comp_expand.composition_id. + */ + public void setCompositionId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.comp_expand.composition_id. + */ + public UUID getCompositionId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.comp_expand.template_id. + */ + public void setTemplateId(String value) { + set(4, value); + } + + /** + * Getter for ehr.comp_expand.template_id. + */ + public String getTemplateId() { + return (String) get(4); + } + + /** + * Setter for ehr.comp_expand.archetype_id. + */ + public void setArchetypeId(String value) { + set(5, value); + } + + /** + * Getter for ehr.comp_expand.archetype_id. + */ + public String getArchetypeId() { + return (String) get(5); + } + + /** + * Setter for ehr.comp_expand.entry. + */ + public void setEntry(JSONB value) { + set(6, value); + } + + /** + * Getter for ehr.comp_expand.entry. + */ + public JSONB getEntry() { + return (JSONB) get(6); + } + + /** + * Setter for ehr.comp_expand.composition_name. + */ + public void setCompositionName(String value) { + set(7, value); + } + + /** + * Getter for ehr.comp_expand.composition_name. + */ + public String getCompositionName() { + return (String) get(7); + } + + /** + * Setter for ehr.comp_expand.language. + */ + public void setLanguage(String value) { + set(8, value); + } + + /** + * Getter for ehr.comp_expand.language. + */ + public String getLanguage() { + return (String) get(8); + } + + /** + * Setter for ehr.comp_expand.territory. + */ + public void setTerritory(Integer value) { + set(9, value); + } + + /** + * Getter for ehr.comp_expand.territory. + */ + public Integer getTerritory() { + return (Integer) get(9); + } + + /** + * Setter for ehr.comp_expand.start_time. + */ + public void setStartTime(Timestamp value) { + set(10, value); + } + + /** + * Getter for ehr.comp_expand.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(10); + } + + /** + * Setter for ehr.comp_expand.start_time_tzid. + */ + public void setStartTimeTzid(String value) { + set(11, value); + } + + /** + * Getter for ehr.comp_expand.start_time_tzid. + */ + public String getStartTimeTzid() { + return (String) get(11); + } + + /** + * Setter for ehr.comp_expand.end_time. + */ + public void setEndTime(Timestamp value) { + set(12, value); + } + + /** + * Getter for ehr.comp_expand.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(12); + } + + /** + * Setter for ehr.comp_expand.end_time_tzid. + */ + public void setEndTimeTzid(String value) { + set(13, value); + } + + /** + * Getter for ehr.comp_expand.end_time_tzid. + */ + public String getEndTimeTzid() { + return (String) get(13); + } + + /** + * Setter for ehr.comp_expand.other_context. + */ + public void setOtherContext(JSONB value) { + set(14, value); + } + + /** + * Getter for ehr.comp_expand.other_context. + */ + public JSONB getOtherContext() { + return (JSONB) get(14); + } + + /** + * Setter for ehr.comp_expand.ctx_location. + */ + public void setCtxLocation(String value) { + set(15, value); + } + + /** + * Getter for ehr.comp_expand.ctx_location. + */ + public String getCtxLocation() { + return (String) get(15); + } + + /** + * Setter for ehr.comp_expand.facility_name. + */ + public void setFacilityName(String value) { + set(16, value); + } + + /** + * Getter for ehr.comp_expand.facility_name. + */ + public String getFacilityName() { + return (String) get(16); + } + + /** + * Setter for ehr.comp_expand.facility_ref. + */ + public void setFacilityRef(String value) { + set(17, value); + } + + /** + * Getter for ehr.comp_expand.facility_ref. + */ + public String getFacilityRef() { + return (String) get(17); + } + + /** + * Setter for ehr.comp_expand.facility_scheme. + */ + public void setFacilityScheme(String value) { + set(18, value); + } + + /** + * Getter for ehr.comp_expand.facility_scheme. + */ + public String getFacilityScheme() { + return (String) get(18); + } + + /** + * Setter for ehr.comp_expand.facility_namespace. + */ + public void setFacilityNamespace(String value) { + set(19, value); + } + + /** + * Getter for ehr.comp_expand.facility_namespace. + */ + public String getFacilityNamespace() { + return (String) get(19); + } + + /** + * Setter for ehr.comp_expand.facility_type. + */ + public void setFacilityType(String value) { + set(20, value); + } + + /** + * Getter for ehr.comp_expand.facility_type. + */ + public String getFacilityType() { + return (String) get(20); + } + + /** + * Setter for ehr.comp_expand.composer_name. + */ + public void setComposerName(String value) { + set(21, value); + } + + /** + * Getter for ehr.comp_expand.composer_name. + */ + public String getComposerName() { + return (String) get(21); + } + + /** + * Setter for ehr.comp_expand.composer_ref. + */ + public void setComposerRef(String value) { + set(22, value); + } + + /** + * Getter for ehr.comp_expand.composer_ref. + */ + public String getComposerRef() { + return (String) get(22); + } + + /** + * Setter for ehr.comp_expand.composer_scheme. + */ + public void setComposerScheme(String value) { + set(23, value); + } + + /** + * Getter for ehr.comp_expand.composer_scheme. + */ + public String getComposerScheme() { + return (String) get(23); + } + + /** + * Setter for ehr.comp_expand.composer_namespace. + */ + public void setComposerNamespace(String value) { + set(24, value); + } + + /** + * Getter for ehr.comp_expand.composer_namespace. + */ + public String getComposerNamespace() { + return (String) get(24); + } + + /** + * Setter for ehr.comp_expand.composer_type. + */ + public void setComposerType(String value) { + set(25, value); + } + + /** + * Getter for ehr.comp_expand.composer_type. + */ + public String getComposerType() { + return (String) get(25); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompExpandRecord + */ + public CompExpandRecord() { + super(CompExpand.COMP_EXPAND); + } + + /** + * Create a detached, initialised CompExpandRecord + */ + public CompExpandRecord( + UUID ehrId, + String subjectExternalrefIdValue, + String subjectExternalrefIdNamespace, + UUID compositionId, + String templateId, + String archetypeId, + JSONB entry, + String compositionName, + String language, + Integer territory, + Timestamp startTime, + String startTimeTzid, + Timestamp endTime, + String endTimeTzid, + JSONB otherContext, + String ctxLocation, + String facilityName, + String facilityRef, + String facilityScheme, + String facilityNamespace, + String facilityType, + String composerName, + String composerRef, + String composerScheme, + String composerNamespace, + String composerType) { + super(CompExpand.COMP_EXPAND); + + setEhrId(ehrId); + setSubjectExternalrefIdValue(subjectExternalrefIdValue); + setSubjectExternalrefIdNamespace(subjectExternalrefIdNamespace); + setCompositionId(compositionId); + setTemplateId(templateId); + setArchetypeId(archetypeId); + setEntry(entry); + setCompositionName(compositionName); + setLanguage(language); + setTerritory(territory); + setStartTime(startTime); + setStartTimeTzid(startTimeTzid); + setEndTime(endTime); + setEndTimeTzid(endTimeTzid); + setOtherContext(otherContext); + setCtxLocation(ctxLocation); + setFacilityName(facilityName); + setFacilityRef(facilityRef); + setFacilityScheme(facilityScheme); + setFacilityNamespace(facilityNamespace); + setFacilityType(facilityType); + setComposerName(composerName); + setComposerRef(composerRef); + setComposerScheme(composerScheme); + setComposerNamespace(composerNamespace); + setComposerType(composerType); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompoXrefRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompoXrefRecord.java new file mode 100644 index 0000000..b673847 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompoXrefRecord.java @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompoXref; +import org.jooq.Field; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompoXrefRecord extends TableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.compo_xref.master_uuid. + */ + public void setMasterUuid(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.compo_xref.master_uuid. + */ + public UUID getMasterUuid() { + return (UUID) get(0); + } + + /** + * Setter for ehr.compo_xref.child_uuid. + */ + public void setChildUuid(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.compo_xref.child_uuid. + */ + public UUID getChildUuid() { + return (UUID) get(1); + } + + /** + * Setter for ehr.compo_xref.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(2, value); + } + + /** + * Getter for ehr.compo_xref.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(2); + } + + /** + * Setter for ehr.compo_xref.sys_tenant. + */ + public void setSysTenant(Short value) { + set(3, value); + } + + /** + * Getter for ehr.compo_xref.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return CompoXref.COMPO_XREF.MASTER_UUID; + } + + @Override + public Field field2() { + return CompoXref.COMPO_XREF.CHILD_UUID; + } + + @Override + public Field field3() { + return CompoXref.COMPO_XREF.SYS_TRANSACTION; + } + + @Override + public Field field4() { + return CompoXref.COMPO_XREF.SYS_TENANT; + } + + @Override + public UUID component1() { + return getMasterUuid(); + } + + @Override + public UUID component2() { + return getChildUuid(); + } + + @Override + public Timestamp component3() { + return getSysTransaction(); + } + + @Override + public Short component4() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getMasterUuid(); + } + + @Override + public UUID value2() { + return getChildUuid(); + } + + @Override + public Timestamp value3() { + return getSysTransaction(); + } + + @Override + public Short value4() { + return getSysTenant(); + } + + @Override + public CompoXrefRecord value1(UUID value) { + setMasterUuid(value); + return this; + } + + @Override + public CompoXrefRecord value2(UUID value) { + setChildUuid(value); + return this; + } + + @Override + public CompoXrefRecord value3(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public CompoXrefRecord value4(Short value) { + setSysTenant(value); + return this; + } + + @Override + public CompoXrefRecord values(UUID value1, UUID value2, Timestamp value3, Short value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompoXrefRecord + */ + public CompoXrefRecord() { + super(CompoXref.COMPO_XREF); + } + + /** + * Create a detached, initialised CompoXrefRecord + */ + public CompoXrefRecord(UUID masterUuid, UUID childUuid, Timestamp sysTransaction, Short sysTenant) { + super(CompoXref.COMPO_XREF); + + setMasterUuid(masterUuid); + setChildUuid(childUuid); + setSysTransaction(sysTransaction); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionHistoryRecord.java new file mode 100644 index 0000000..a7f3d2e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionHistoryRecord.java @@ -0,0 +1,709 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompositionHistory; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record15; +import org.jooq.Row15; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompositionHistoryRecord extends TableRecordImpl + implements Record15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.composition_history.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.composition_history.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.composition_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.composition_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.composition_history.in_contribution. + */ + public void setInContribution(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.composition_history.in_contribution. + */ + public UUID getInContribution() { + return (UUID) get(2); + } + + /** + * Setter for ehr.composition_history.active. + */ + public void setActive(Boolean value) { + set(3, value); + } + + /** + * Getter for ehr.composition_history.active. + */ + public Boolean getActive() { + return (Boolean) get(3); + } + + /** + * Setter for ehr.composition_history.is_persistent. + */ + public void setIsPersistent(Boolean value) { + set(4, value); + } + + /** + * Getter for ehr.composition_history.is_persistent. + */ + public Boolean getIsPersistent() { + return (Boolean) get(4); + } + + /** + * Setter for ehr.composition_history.language. + */ + public void setLanguage(String value) { + set(5, value); + } + + /** + * Getter for ehr.composition_history.language. + */ + public String getLanguage() { + return (String) get(5); + } + + /** + * Setter for ehr.composition_history.territory. + */ + public void setTerritory(Integer value) { + set(6, value); + } + + /** + * Getter for ehr.composition_history.territory. + */ + public Integer getTerritory() { + return (Integer) get(6); + } + + /** + * Setter for ehr.composition_history.composer. + */ + public void setComposer(UUID value) { + set(7, value); + } + + /** + * Getter for ehr.composition_history.composer. + */ + public UUID getComposer() { + return (UUID) get(7); + } + + /** + * Setter for ehr.composition_history.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(8, value); + } + + /** + * Getter for ehr.composition_history.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(8); + } + + /** + * Setter for ehr.composition_history.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(9, value); + } + + /** + * Getter for ehr.composition_history.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(9); + } + + /** + * Setter for ehr.composition_history.has_audit. + */ + public void setHasAudit(UUID value) { + set(10, value); + } + + /** + * Getter for ehr.composition_history.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(10); + } + + /** + * Setter for ehr.composition_history.attestation_ref. + */ + public void setAttestationRef(UUID value) { + set(11, value); + } + + /** + * Getter for ehr.composition_history.attestation_ref. + */ + public UUID getAttestationRef() { + return (UUID) get(11); + } + + /** + * Setter for ehr.composition_history.feeder_audit. + */ + public void setFeederAudit(JSONB value) { + set(12, value); + } + + /** + * Getter for ehr.composition_history.feeder_audit. + */ + public JSONB getFeederAudit() { + return (JSONB) get(12); + } + + /** + * Setter for ehr.composition_history.links. + */ + public void setLinks(JSONB value) { + set(13, value); + } + + /** + * Getter for ehr.composition_history.links. + */ + public JSONB getLinks() { + return (JSONB) get(13); + } + + /** + * Setter for ehr.composition_history.sys_tenant. + */ + public void setSysTenant(Short value) { + set(14, value); + } + + /** + * Getter for ehr.composition_history.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(14); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> + valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return CompositionHistory.COMPOSITION_HISTORY.ID; + } + + @Override + public Field field2() { + return CompositionHistory.COMPOSITION_HISTORY.EHR_ID; + } + + @Override + public Field field3() { + return CompositionHistory.COMPOSITION_HISTORY.IN_CONTRIBUTION; + } + + @Override + public Field field4() { + return CompositionHistory.COMPOSITION_HISTORY.ACTIVE; + } + + @Override + public Field field5() { + return CompositionHistory.COMPOSITION_HISTORY.IS_PERSISTENT; + } + + @Override + public Field field6() { + return CompositionHistory.COMPOSITION_HISTORY.LANGUAGE; + } + + @Override + public Field field7() { + return CompositionHistory.COMPOSITION_HISTORY.TERRITORY; + } + + @Override + public Field field8() { + return CompositionHistory.COMPOSITION_HISTORY.COMPOSER; + } + + @Override + public Field field9() { + return CompositionHistory.COMPOSITION_HISTORY.SYS_TRANSACTION; + } + + @Override + public Field> field10() { + return CompositionHistory.COMPOSITION_HISTORY.SYS_PERIOD; + } + + @Override + public Field field11() { + return CompositionHistory.COMPOSITION_HISTORY.HAS_AUDIT; + } + + @Override + public Field field12() { + return CompositionHistory.COMPOSITION_HISTORY.ATTESTATION_REF; + } + + @Override + public Field field13() { + return CompositionHistory.COMPOSITION_HISTORY.FEEDER_AUDIT; + } + + @Override + public Field field14() { + return CompositionHistory.COMPOSITION_HISTORY.LINKS; + } + + @Override + public Field field15() { + return CompositionHistory.COMPOSITION_HISTORY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getInContribution(); + } + + @Override + public Boolean component4() { + return getActive(); + } + + @Override + public Boolean component5() { + return getIsPersistent(); + } + + @Override + public String component6() { + return getLanguage(); + } + + @Override + public Integer component7() { + return getTerritory(); + } + + @Override + public UUID component8() { + return getComposer(); + } + + @Override + public Timestamp component9() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component10() { + return getSysPeriod(); + } + + @Override + public UUID component11() { + return getHasAudit(); + } + + @Override + public UUID component12() { + return getAttestationRef(); + } + + @Override + public JSONB component13() { + return getFeederAudit(); + } + + @Override + public JSONB component14() { + return getLinks(); + } + + @Override + public Short component15() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getInContribution(); + } + + @Override + public Boolean value4() { + return getActive(); + } + + @Override + public Boolean value5() { + return getIsPersistent(); + } + + @Override + public String value6() { + return getLanguage(); + } + + @Override + public Integer value7() { + return getTerritory(); + } + + @Override + public UUID value8() { + return getComposer(); + } + + @Override + public Timestamp value9() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value10() { + return getSysPeriod(); + } + + @Override + public UUID value11() { + return getHasAudit(); + } + + @Override + public UUID value12() { + return getAttestationRef(); + } + + @Override + public JSONB value13() { + return getFeederAudit(); + } + + @Override + public JSONB value14() { + return getLinks(); + } + + @Override + public Short value15() { + return getSysTenant(); + } + + @Override + public CompositionHistoryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public CompositionHistoryRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public CompositionHistoryRecord value3(UUID value) { + setInContribution(value); + return this; + } + + @Override + public CompositionHistoryRecord value4(Boolean value) { + setActive(value); + return this; + } + + @Override + public CompositionHistoryRecord value5(Boolean value) { + setIsPersistent(value); + return this; + } + + @Override + public CompositionHistoryRecord value6(String value) { + setLanguage(value); + return this; + } + + @Override + public CompositionHistoryRecord value7(Integer value) { + setTerritory(value); + return this; + } + + @Override + public CompositionHistoryRecord value8(UUID value) { + setComposer(value); + return this; + } + + @Override + public CompositionHistoryRecord value9(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public CompositionHistoryRecord value10(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public CompositionHistoryRecord value11(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public CompositionHistoryRecord value12(UUID value) { + setAttestationRef(value); + return this; + } + + @Override + public CompositionHistoryRecord value13(JSONB value) { + setFeederAudit(value); + return this; + } + + @Override + public CompositionHistoryRecord value14(JSONB value) { + setLinks(value); + return this; + } + + @Override + public CompositionHistoryRecord value15(Short value) { + setSysTenant(value); + return this; + } + + @Override + public CompositionHistoryRecord values( + UUID value1, + UUID value2, + UUID value3, + Boolean value4, + Boolean value5, + String value6, + Integer value7, + UUID value8, + Timestamp value9, + SimpleEntry value10, + UUID value11, + UUID value12, + JSONB value13, + JSONB value14, + Short value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompositionHistoryRecord + */ + public CompositionHistoryRecord() { + super(CompositionHistory.COMPOSITION_HISTORY); + } + + /** + * Create a detached, initialised CompositionHistoryRecord + */ + public CompositionHistoryRecord( + UUID id, + UUID ehrId, + UUID inContribution, + Boolean active, + Boolean isPersistent, + String language, + Integer territory, + UUID composer, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + UUID hasAudit, + UUID attestationRef, + JSONB feederAudit, + JSONB links, + Short sysTenant) { + super(CompositionHistory.COMPOSITION_HISTORY); + + setId(id); + setEhrId(ehrId); + setInContribution(inContribution); + setActive(active); + setIsPersistent(isPersistent); + setLanguage(language); + setTerritory(territory); + setComposer(composer); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setHasAudit(hasAudit); + setAttestationRef(attestationRef); + setFeederAudit(feederAudit); + setLinks(links); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionRecord.java new file mode 100644 index 0000000..46fd7b1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/CompositionRecord.java @@ -0,0 +1,719 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Composition; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record15; +import org.jooq.Record2; +import org.jooq.Row15; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * Composition table + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CompositionRecord extends UpdatableRecordImpl + implements Record15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.composition.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.composition.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.composition.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.composition.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.composition.in_contribution. + */ + public void setInContribution(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.composition.in_contribution. + */ + public UUID getInContribution() { + return (UUID) get(2); + } + + /** + * Setter for ehr.composition.active. + */ + public void setActive(Boolean value) { + set(3, value); + } + + /** + * Getter for ehr.composition.active. + */ + public Boolean getActive() { + return (Boolean) get(3); + } + + /** + * Setter for ehr.composition.is_persistent. + */ + public void setIsPersistent(Boolean value) { + set(4, value); + } + + /** + * Getter for ehr.composition.is_persistent. + */ + public Boolean getIsPersistent() { + return (Boolean) get(4); + } + + /** + * Setter for ehr.composition.language. + */ + public void setLanguage(String value) { + set(5, value); + } + + /** + * Getter for ehr.composition.language. + */ + public String getLanguage() { + return (String) get(5); + } + + /** + * Setter for ehr.composition.territory. + */ + public void setTerritory(Integer value) { + set(6, value); + } + + /** + * Getter for ehr.composition.territory. + */ + public Integer getTerritory() { + return (Integer) get(6); + } + + /** + * Setter for ehr.composition.composer. + */ + public void setComposer(UUID value) { + set(7, value); + } + + /** + * Getter for ehr.composition.composer. + */ + public UUID getComposer() { + return (UUID) get(7); + } + + /** + * Setter for ehr.composition.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(8, value); + } + + /** + * Getter for ehr.composition.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(8); + } + + /** + * Setter for ehr.composition.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(9, value); + } + + /** + * Getter for ehr.composition.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(9); + } + + /** + * Setter for ehr.composition.has_audit. + */ + public void setHasAudit(UUID value) { + set(10, value); + } + + /** + * Getter for ehr.composition.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(10); + } + + /** + * Setter for ehr.composition.attestation_ref. + */ + public void setAttestationRef(UUID value) { + set(11, value); + } + + /** + * Getter for ehr.composition.attestation_ref. + */ + public UUID getAttestationRef() { + return (UUID) get(11); + } + + /** + * Setter for ehr.composition.feeder_audit. + */ + public void setFeederAudit(JSONB value) { + set(12, value); + } + + /** + * Getter for ehr.composition.feeder_audit. + */ + public JSONB getFeederAudit() { + return (JSONB) get(12); + } + + /** + * Setter for ehr.composition.links. + */ + public void setLinks(JSONB value) { + set(13, value); + } + + /** + * Getter for ehr.composition.links. + */ + public JSONB getLinks() { + return (JSONB) get(13); + } + + /** + * Setter for ehr.composition.sys_tenant. + */ + public void setSysTenant(Short value) { + set(14, value); + } + + /** + * Getter for ehr.composition.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(14); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15< + UUID, + UUID, + UUID, + Boolean, + Boolean, + String, + Integer, + UUID, + Timestamp, + SimpleEntry, + UUID, + UUID, + JSONB, + JSONB, + Short> + valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return Composition.COMPOSITION.ID; + } + + @Override + public Field field2() { + return Composition.COMPOSITION.EHR_ID; + } + + @Override + public Field field3() { + return Composition.COMPOSITION.IN_CONTRIBUTION; + } + + @Override + public Field field4() { + return Composition.COMPOSITION.ACTIVE; + } + + @Override + public Field field5() { + return Composition.COMPOSITION.IS_PERSISTENT; + } + + @Override + public Field field6() { + return Composition.COMPOSITION.LANGUAGE; + } + + @Override + public Field field7() { + return Composition.COMPOSITION.TERRITORY; + } + + @Override + public Field field8() { + return Composition.COMPOSITION.COMPOSER; + } + + @Override + public Field field9() { + return Composition.COMPOSITION.SYS_TRANSACTION; + } + + @Override + public Field> field10() { + return Composition.COMPOSITION.SYS_PERIOD; + } + + @Override + public Field field11() { + return Composition.COMPOSITION.HAS_AUDIT; + } + + @Override + public Field field12() { + return Composition.COMPOSITION.ATTESTATION_REF; + } + + @Override + public Field field13() { + return Composition.COMPOSITION.FEEDER_AUDIT; + } + + @Override + public Field field14() { + return Composition.COMPOSITION.LINKS; + } + + @Override + public Field field15() { + return Composition.COMPOSITION.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getInContribution(); + } + + @Override + public Boolean component4() { + return getActive(); + } + + @Override + public Boolean component5() { + return getIsPersistent(); + } + + @Override + public String component6() { + return getLanguage(); + } + + @Override + public Integer component7() { + return getTerritory(); + } + + @Override + public UUID component8() { + return getComposer(); + } + + @Override + public Timestamp component9() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component10() { + return getSysPeriod(); + } + + @Override + public UUID component11() { + return getHasAudit(); + } + + @Override + public UUID component12() { + return getAttestationRef(); + } + + @Override + public JSONB component13() { + return getFeederAudit(); + } + + @Override + public JSONB component14() { + return getLinks(); + } + + @Override + public Short component15() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getInContribution(); + } + + @Override + public Boolean value4() { + return getActive(); + } + + @Override + public Boolean value5() { + return getIsPersistent(); + } + + @Override + public String value6() { + return getLanguage(); + } + + @Override + public Integer value7() { + return getTerritory(); + } + + @Override + public UUID value8() { + return getComposer(); + } + + @Override + public Timestamp value9() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value10() { + return getSysPeriod(); + } + + @Override + public UUID value11() { + return getHasAudit(); + } + + @Override + public UUID value12() { + return getAttestationRef(); + } + + @Override + public JSONB value13() { + return getFeederAudit(); + } + + @Override + public JSONB value14() { + return getLinks(); + } + + @Override + public Short value15() { + return getSysTenant(); + } + + @Override + public CompositionRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public CompositionRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public CompositionRecord value3(UUID value) { + setInContribution(value); + return this; + } + + @Override + public CompositionRecord value4(Boolean value) { + setActive(value); + return this; + } + + @Override + public CompositionRecord value5(Boolean value) { + setIsPersistent(value); + return this; + } + + @Override + public CompositionRecord value6(String value) { + setLanguage(value); + return this; + } + + @Override + public CompositionRecord value7(Integer value) { + setTerritory(value); + return this; + } + + @Override + public CompositionRecord value8(UUID value) { + setComposer(value); + return this; + } + + @Override + public CompositionRecord value9(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public CompositionRecord value10(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public CompositionRecord value11(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public CompositionRecord value12(UUID value) { + setAttestationRef(value); + return this; + } + + @Override + public CompositionRecord value13(JSONB value) { + setFeederAudit(value); + return this; + } + + @Override + public CompositionRecord value14(JSONB value) { + setLinks(value); + return this; + } + + @Override + public CompositionRecord value15(Short value) { + setSysTenant(value); + return this; + } + + @Override + public CompositionRecord values( + UUID value1, + UUID value2, + UUID value3, + Boolean value4, + Boolean value5, + String value6, + Integer value7, + UUID value8, + Timestamp value9, + SimpleEntry value10, + UUID value11, + UUID value12, + JSONB value13, + JSONB value14, + Short value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompositionRecord + */ + public CompositionRecord() { + super(Composition.COMPOSITION); + } + + /** + * Create a detached, initialised CompositionRecord + */ + public CompositionRecord( + UUID id, + UUID ehrId, + UUID inContribution, + Boolean active, + Boolean isPersistent, + String language, + Integer territory, + UUID composer, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + UUID hasAudit, + UUID attestationRef, + JSONB feederAudit, + JSONB links, + Short sysTenant) { + super(Composition.COMPOSITION); + + setId(id); + setEhrId(ehrId); + setInContribution(inContribution); + setActive(active); + setIsPersistent(isPersistent); + setLanguage(language); + setTerritory(territory); + setComposer(composer); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setHasAudit(hasAudit); + setAttestationRef(attestationRef); + setFeederAudit(feederAudit); + setLinks(links); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ConceptRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ConceptRecord.java new file mode 100644 index 0000000..677f3fd --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ConceptRecord.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Concept; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * openEHR common concepts (e.g. terminology) used in the system + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class ConceptRecord extends UpdatableRecordImpl + implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.concept.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.concept.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.concept.conceptid. + */ + public void setConceptid(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.concept.conceptid. + */ + public Integer getConceptid() { + return (Integer) get(1); + } + + /** + * Setter for ehr.concept.language. + */ + public void setLanguage(String value) { + set(2, value); + } + + /** + * Getter for ehr.concept.language. + */ + public String getLanguage() { + return (String) get(2); + } + + /** + * Setter for ehr.concept.description. + */ + public void setDescription(String value) { + set(3, value); + } + + /** + * Getter for ehr.concept.description. + */ + public String getDescription() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Concept.CONCEPT.ID; + } + + @Override + public Field field2() { + return Concept.CONCEPT.CONCEPTID; + } + + @Override + public Field field3() { + return Concept.CONCEPT.LANGUAGE; + } + + @Override + public Field field4() { + return Concept.CONCEPT.DESCRIPTION; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public Integer component2() { + return getConceptid(); + } + + @Override + public String component3() { + return getLanguage(); + } + + @Override + public String component4() { + return getDescription(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public Integer value2() { + return getConceptid(); + } + + @Override + public String value3() { + return getLanguage(); + } + + @Override + public String value4() { + return getDescription(); + } + + @Override + public ConceptRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public ConceptRecord value2(Integer value) { + setConceptid(value); + return this; + } + + @Override + public ConceptRecord value3(String value) { + setLanguage(value); + return this; + } + + @Override + public ConceptRecord value4(String value) { + setDescription(value); + return this; + } + + @Override + public ConceptRecord values(UUID value1, Integer value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ConceptRecord + */ + public ConceptRecord() { + super(Concept.CONCEPT); + } + + /** + * Create a detached, initialised ConceptRecord + */ + public ConceptRecord(UUID id, Integer conceptid, String language, String description) { + super(Concept.CONCEPT); + + setId(id); + setConceptid(conceptid); + setLanguage(language); + setDescription(description); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ContributionRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ContributionRecord.java new file mode 100644 index 0000000..ec73421 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ContributionRecord.java @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionDataType; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.ContributionState; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Contribution; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * Contribution table, compositions reference this table + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class ContributionRecord extends UpdatableRecordImpl + implements Record7 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.contribution.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.contribution.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.contribution.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.contribution.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.contribution.contribution_type. + */ + public void setContributionType(ContributionDataType value) { + set(2, value); + } + + /** + * Getter for ehr.contribution.contribution_type. + */ + public ContributionDataType getContributionType() { + return (ContributionDataType) get(2); + } + + /** + * Setter for ehr.contribution.state. + */ + public void setState(ContributionState value) { + set(3, value); + } + + /** + * Getter for ehr.contribution.state. + */ + public ContributionState getState() { + return (ContributionState) get(3); + } + + /** + * Setter for ehr.contribution.signature. + */ + public void setSignature(String value) { + set(4, value); + } + + /** + * Getter for ehr.contribution.signature. + */ + public String getSignature() { + return (String) get(4); + } + + /** + * Setter for ehr.contribution.has_audit. + */ + public void setHasAudit(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.contribution.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(5); + } + + /** + * Setter for ehr.contribution.sys_tenant. + */ + public void setSysTenant(Short value) { + set(6, value); + } + + /** + * Getter for ehr.contribution.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return Contribution.CONTRIBUTION.ID; + } + + @Override + public Field field2() { + return Contribution.CONTRIBUTION.EHR_ID; + } + + @Override + public Field field3() { + return Contribution.CONTRIBUTION.CONTRIBUTION_TYPE; + } + + @Override + public Field field4() { + return Contribution.CONTRIBUTION.STATE; + } + + @Override + public Field field5() { + return Contribution.CONTRIBUTION.SIGNATURE; + } + + @Override + public Field field6() { + return Contribution.CONTRIBUTION.HAS_AUDIT; + } + + @Override + public Field field7() { + return Contribution.CONTRIBUTION.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public ContributionDataType component3() { + return getContributionType(); + } + + @Override + public ContributionState component4() { + return getState(); + } + + @Override + public String component5() { + return getSignature(); + } + + @Override + public UUID component6() { + return getHasAudit(); + } + + @Override + public Short component7() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public ContributionDataType value3() { + return getContributionType(); + } + + @Override + public ContributionState value4() { + return getState(); + } + + @Override + public String value5() { + return getSignature(); + } + + @Override + public UUID value6() { + return getHasAudit(); + } + + @Override + public Short value7() { + return getSysTenant(); + } + + @Override + public ContributionRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public ContributionRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public ContributionRecord value3(ContributionDataType value) { + setContributionType(value); + return this; + } + + @Override + public ContributionRecord value4(ContributionState value) { + setState(value); + return this; + } + + @Override + public ContributionRecord value5(String value) { + setSignature(value); + return this; + } + + @Override + public ContributionRecord value6(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public ContributionRecord value7(Short value) { + setSysTenant(value); + return this; + } + + @Override + public ContributionRecord values( + UUID value1, + UUID value2, + ContributionDataType value3, + ContributionState value4, + String value5, + UUID value6, + Short value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ContributionRecord + */ + public ContributionRecord() { + super(Contribution.CONTRIBUTION); + } + + /** + * Create a detached, initialised ContributionRecord + */ + public ContributionRecord( + UUID id, + UUID ehrId, + ContributionDataType contributionType, + ContributionState state, + String signature, + UUID hasAudit, + Short sysTenant) { + super(Contribution.CONTRIBUTION); + + setId(id); + setEhrId(ehrId); + setContributionType(contributionType); + setState(state); + setSignature(signature); + setHasAudit(hasAudit); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderHistoryRecord.java new file mode 100644 index 0000000..8a2c1e8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderHistoryRecord.java @@ -0,0 +1,844 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolderHistory; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record18; +import org.jooq.Record4; +import org.jooq.Row18; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrFolderHistoryRecord extends UpdatableRecordImpl + implements Record18< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + OffsetDateTime, + Boolean, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_folder_history.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_folder_history.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_folder_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_folder_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.ehr_folder_history.ehr_folders_idx. + */ + public void setEhrFoldersIdx(Integer value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_folder_history.ehr_folders_idx. + */ + public Integer getEhrFoldersIdx() { + return (Integer) get(2); + } + + /** + * Setter for ehr.ehr_folder_history.row_num. + */ + public void setRowNum(Integer value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_folder_history.row_num. + */ + public Integer getRowNum() { + return (Integer) get(3); + } + + /** + * Setter for ehr.ehr_folder_history.contribution_id. + */ + public void setContributionId(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_folder_history.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(4); + } + + /** + * Setter for ehr.ehr_folder_history.audit_id. + */ + public void setAuditId(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_folder_history.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(5); + } + + /** + * Setter for ehr.ehr_folder_history.archetype_node_id. + */ + public void setArchetypeNodeId(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_folder_history.archetype_node_id. + */ + public String getArchetypeNodeId() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_folder_history.path. + */ + public void setPath(String[] value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_folder_history.path. + */ + public String[] getPath() { + return (String[]) get(7); + } + + /** + * Setter for ehr.ehr_folder_history.hierarchy_idx. + */ + public void setHierarchyIdx(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_folder_history.hierarchy_idx. + */ + public String getHierarchyIdx() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_folder_history.hierarchy_idx_cap. + */ + public void setHierarchyIdxCap(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_folder_history.hierarchy_idx_cap. + */ + public String getHierarchyIdxCap() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_folder_history.hierarchy_idx_len. + */ + public void setHierarchyIdxLen(Integer value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_folder_history.hierarchy_idx_len. + */ + public Integer getHierarchyIdxLen() { + return (Integer) get(10); + } + + /** + * Setter for ehr.ehr_folder_history.items. + */ + public void setItems(UUID[] value) { + set(11, value); + } + + /** + * Getter for ehr.ehr_folder_history.items. + */ + public UUID[] getItems() { + return (UUID[]) get(11); + } + + /** + * Setter for ehr.ehr_folder_history.fields. + */ + public void setFields(JSONB value) { + set(12, value); + } + + /** + * Getter for ehr.ehr_folder_history.fields. + */ + public JSONB getFields() { + return (JSONB) get(12); + } + + /** + * Setter for ehr.ehr_folder_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(13, value); + } + + /** + * Getter for ehr.ehr_folder_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(13); + } + + /** + * Setter for ehr.ehr_folder_history.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(14, value); + } + + /** + * Getter for ehr.ehr_folder_history.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(14); + } + + /** + * Setter for ehr.ehr_folder_history.sys_period_upper. + */ + public void setSysPeriodUpper(OffsetDateTime value) { + set(15, value); + } + + /** + * Getter for ehr.ehr_folder_history.sys_period_upper. + */ + public OffsetDateTime getSysPeriodUpper() { + return (OffsetDateTime) get(15); + } + + /** + * Setter for ehr.ehr_folder_history.sys_deleted. + */ + public void setSysDeleted(Boolean value) { + set(16, value); + } + + /** + * Getter for ehr.ehr_folder_history.sys_deleted. + */ + public Boolean getSysDeleted() { + return (Boolean) get(16); + } + + /** + * Setter for ehr.ehr_folder_history.sys_tenant. + */ + public void setSysTenant(Short value) { + set(17, value); + } + + /** + * Getter for ehr.ehr_folder_history.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(17); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record4 key() { + return (Record4) super.key(); + } + + // ------------------------------------------------------------------------- + // Record18 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row18< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + OffsetDateTime, + Boolean, + Short> + fieldsRow() { + return (Row18) super.fieldsRow(); + } + + @Override + public Row18< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + OffsetDateTime, + Boolean, + Short> + valuesRow() { + return (Row18) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.ID; + } + + @Override + public Field field2() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.EHR_ID; + } + + @Override + public Field field3() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.EHR_FOLDERS_IDX; + } + + @Override + public Field field4() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.ROW_NUM; + } + + @Override + public Field field5() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.CONTRIBUTION_ID; + } + + @Override + public Field field6() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.AUDIT_ID; + } + + @Override + public Field field7() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.ARCHETYPE_NODE_ID; + } + + @Override + public Field field8() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.PATH; + } + + @Override + public Field field9() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.HIERARCHY_IDX; + } + + @Override + public Field field10() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.HIERARCHY_IDX_CAP; + } + + @Override + public Field field11() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.HIERARCHY_IDX_LEN; + } + + @Override + public Field field12() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.ITEMS; + } + + @Override + public Field field13() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.FIELDS; + } + + @Override + public Field field14() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_VERSION; + } + + @Override + public Field field15() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_PERIOD_LOWER; + } + + @Override + public Field field16() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_PERIOD_UPPER; + } + + @Override + public Field field17() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_DELETED; + } + + @Override + public Field field18() { + return EhrFolderHistory.EHR_FOLDER_HISTORY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public Integer component3() { + return getEhrFoldersIdx(); + } + + @Override + public Integer component4() { + return getRowNum(); + } + + @Override + public UUID component5() { + return getContributionId(); + } + + @Override + public UUID component6() { + return getAuditId(); + } + + @Override + public String component7() { + return getArchetypeNodeId(); + } + + @Override + public String[] component8() { + return getPath(); + } + + @Override + public String component9() { + return getHierarchyIdx(); + } + + @Override + public String component10() { + return getHierarchyIdxCap(); + } + + @Override + public Integer component11() { + return getHierarchyIdxLen(); + } + + @Override + public UUID[] component12() { + return getItems(); + } + + @Override + public JSONB component13() { + return getFields(); + } + + @Override + public Integer component14() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component15() { + return getSysPeriodLower(); + } + + @Override + public OffsetDateTime component16() { + return getSysPeriodUpper(); + } + + @Override + public Boolean component17() { + return getSysDeleted(); + } + + @Override + public Short component18() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public Integer value3() { + return getEhrFoldersIdx(); + } + + @Override + public Integer value4() { + return getRowNum(); + } + + @Override + public UUID value5() { + return getContributionId(); + } + + @Override + public UUID value6() { + return getAuditId(); + } + + @Override + public String value7() { + return getArchetypeNodeId(); + } + + @Override + public String[] value8() { + return getPath(); + } + + @Override + public String value9() { + return getHierarchyIdx(); + } + + @Override + public String value10() { + return getHierarchyIdxCap(); + } + + @Override + public Integer value11() { + return getHierarchyIdxLen(); + } + + @Override + public UUID[] value12() { + return getItems(); + } + + @Override + public JSONB value13() { + return getFields(); + } + + @Override + public Integer value14() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value15() { + return getSysPeriodLower(); + } + + @Override + public OffsetDateTime value16() { + return getSysPeriodUpper(); + } + + @Override + public Boolean value17() { + return getSysDeleted(); + } + + @Override + public Short value18() { + return getSysTenant(); + } + + @Override + public EhrFolderHistoryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value3(Integer value) { + setEhrFoldersIdx(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value4(Integer value) { + setRowNum(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value5(UUID value) { + setContributionId(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value6(UUID value) { + setAuditId(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value7(String value) { + setArchetypeNodeId(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value8(String[] value) { + setPath(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value9(String value) { + setHierarchyIdx(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value10(String value) { + setHierarchyIdxCap(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value11(Integer value) { + setHierarchyIdxLen(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value12(UUID[] value) { + setItems(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value13(JSONB value) { + setFields(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value14(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value15(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value16(OffsetDateTime value) { + setSysPeriodUpper(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value17(Boolean value) { + setSysDeleted(value); + return this; + } + + @Override + public EhrFolderHistoryRecord value18(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EhrFolderHistoryRecord values( + UUID value1, + UUID value2, + Integer value3, + Integer value4, + UUID value5, + UUID value6, + String value7, + String[] value8, + String value9, + String value10, + Integer value11, + UUID[] value12, + JSONB value13, + Integer value14, + OffsetDateTime value15, + OffsetDateTime value16, + Boolean value17, + Short value18) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + value16(value16); + value17(value17); + value18(value18); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrFolderHistoryRecord + */ + public EhrFolderHistoryRecord() { + super(EhrFolderHistory.EHR_FOLDER_HISTORY); + } + + /** + * Create a detached, initialised EhrFolderHistoryRecord + */ + public EhrFolderHistoryRecord( + UUID id, + UUID ehrId, + Integer ehrFoldersIdx, + Integer rowNum, + UUID contributionId, + UUID auditId, + String archetypeNodeId, + String[] path, + String hierarchyIdx, + String hierarchyIdxCap, + Integer hierarchyIdxLen, + UUID[] items, + JSONB fields, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + OffsetDateTime sysPeriodUpper, + Boolean sysDeleted, + Short sysTenant) { + super(EhrFolderHistory.EHR_FOLDER_HISTORY); + + setId(id); + setEhrId(ehrId); + setEhrFoldersIdx(ehrFoldersIdx); + setRowNum(rowNum); + setContributionId(contributionId); + setAuditId(auditId); + setArchetypeNodeId(archetypeNodeId); + setPath(path); + setHierarchyIdx(hierarchyIdx); + setHierarchyIdxCap(hierarchyIdxCap); + setHierarchyIdxLen(hierarchyIdxLen); + setItems(items); + setFields(fields); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setSysPeriodUpper(sysPeriodUpper); + setSysDeleted(sysDeleted); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderRecord.java new file mode 100644 index 0000000..8af71b2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrFolderRecord.java @@ -0,0 +1,760 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrFolder; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record16; +import org.jooq.Record3; +import org.jooq.Row16; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrFolderRecord extends UpdatableRecordImpl + implements Record16< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_folder.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_folder.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_folder.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_folder.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.ehr_folder.ehr_folders_idx. + */ + public void setEhrFoldersIdx(Integer value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_folder.ehr_folders_idx. + */ + public Integer getEhrFoldersIdx() { + return (Integer) get(2); + } + + /** + * Setter for ehr.ehr_folder.row_num. + */ + public void setRowNum(Integer value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_folder.row_num. + */ + public Integer getRowNum() { + return (Integer) get(3); + } + + /** + * Setter for ehr.ehr_folder.contribution_id. + */ + public void setContributionId(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_folder.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(4); + } + + /** + * Setter for ehr.ehr_folder.audit_id. + */ + public void setAuditId(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_folder.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(5); + } + + /** + * Setter for ehr.ehr_folder.archetype_node_id. + */ + public void setArchetypeNodeId(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_folder.archetype_node_id. + */ + public String getArchetypeNodeId() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_folder.path. + */ + public void setPath(String[] value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_folder.path. + */ + public String[] getPath() { + return (String[]) get(7); + } + + /** + * Setter for ehr.ehr_folder.hierarchy_idx. + */ + public void setHierarchyIdx(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_folder.hierarchy_idx. + */ + public String getHierarchyIdx() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_folder.hierarchy_idx_cap. + */ + public void setHierarchyIdxCap(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_folder.hierarchy_idx_cap. + */ + public String getHierarchyIdxCap() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_folder.hierarchy_idx_len. + */ + public void setHierarchyIdxLen(Integer value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_folder.hierarchy_idx_len. + */ + public Integer getHierarchyIdxLen() { + return (Integer) get(10); + } + + /** + * Setter for ehr.ehr_folder.items. + */ + public void setItems(UUID[] value) { + set(11, value); + } + + /** + * Getter for ehr.ehr_folder.items. + */ + public UUID[] getItems() { + return (UUID[]) get(11); + } + + /** + * Setter for ehr.ehr_folder.fields. + */ + public void setFields(JSONB value) { + set(12, value); + } + + /** + * Getter for ehr.ehr_folder.fields. + */ + public JSONB getFields() { + return (JSONB) get(12); + } + + /** + * Setter for ehr.ehr_folder.sys_version. + */ + public void setSysVersion(Integer value) { + set(13, value); + } + + /** + * Getter for ehr.ehr_folder.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(13); + } + + /** + * Setter for ehr.ehr_folder.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(14, value); + } + + /** + * Getter for ehr.ehr_folder.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(14); + } + + /** + * Setter for ehr.ehr_folder.sys_tenant. + */ + public void setSysTenant(Short value) { + set(15, value); + } + + /** + * Getter for ehr.ehr_folder.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(15); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record3 key() { + return (Record3) super.key(); + } + + // ------------------------------------------------------------------------- + // Record16 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row16< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + Short> + fieldsRow() { + return (Row16) super.fieldsRow(); + } + + @Override + public Row16< + UUID, + UUID, + Integer, + Integer, + UUID, + UUID, + String, + String[], + String, + String, + Integer, + UUID[], + JSONB, + Integer, + OffsetDateTime, + Short> + valuesRow() { + return (Row16) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrFolder.EHR_FOLDER.ID; + } + + @Override + public Field field2() { + return EhrFolder.EHR_FOLDER.EHR_ID; + } + + @Override + public Field field3() { + return EhrFolder.EHR_FOLDER.EHR_FOLDERS_IDX; + } + + @Override + public Field field4() { + return EhrFolder.EHR_FOLDER.ROW_NUM; + } + + @Override + public Field field5() { + return EhrFolder.EHR_FOLDER.CONTRIBUTION_ID; + } + + @Override + public Field field6() { + return EhrFolder.EHR_FOLDER.AUDIT_ID; + } + + @Override + public Field field7() { + return EhrFolder.EHR_FOLDER.ARCHETYPE_NODE_ID; + } + + @Override + public Field field8() { + return EhrFolder.EHR_FOLDER.PATH; + } + + @Override + public Field field9() { + return EhrFolder.EHR_FOLDER.HIERARCHY_IDX; + } + + @Override + public Field field10() { + return EhrFolder.EHR_FOLDER.HIERARCHY_IDX_CAP; + } + + @Override + public Field field11() { + return EhrFolder.EHR_FOLDER.HIERARCHY_IDX_LEN; + } + + @Override + public Field field12() { + return EhrFolder.EHR_FOLDER.ITEMS; + } + + @Override + public Field field13() { + return EhrFolder.EHR_FOLDER.FIELDS; + } + + @Override + public Field field14() { + return EhrFolder.EHR_FOLDER.SYS_VERSION; + } + + @Override + public Field field15() { + return EhrFolder.EHR_FOLDER.SYS_PERIOD_LOWER; + } + + @Override + public Field field16() { + return EhrFolder.EHR_FOLDER.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public Integer component3() { + return getEhrFoldersIdx(); + } + + @Override + public Integer component4() { + return getRowNum(); + } + + @Override + public UUID component5() { + return getContributionId(); + } + + @Override + public UUID component6() { + return getAuditId(); + } + + @Override + public String component7() { + return getArchetypeNodeId(); + } + + @Override + public String[] component8() { + return getPath(); + } + + @Override + public String component9() { + return getHierarchyIdx(); + } + + @Override + public String component10() { + return getHierarchyIdxCap(); + } + + @Override + public Integer component11() { + return getHierarchyIdxLen(); + } + + @Override + public UUID[] component12() { + return getItems(); + } + + @Override + public JSONB component13() { + return getFields(); + } + + @Override + public Integer component14() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component15() { + return getSysPeriodLower(); + } + + @Override + public Short component16() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public Integer value3() { + return getEhrFoldersIdx(); + } + + @Override + public Integer value4() { + return getRowNum(); + } + + @Override + public UUID value5() { + return getContributionId(); + } + + @Override + public UUID value6() { + return getAuditId(); + } + + @Override + public String value7() { + return getArchetypeNodeId(); + } + + @Override + public String[] value8() { + return getPath(); + } + + @Override + public String value9() { + return getHierarchyIdx(); + } + + @Override + public String value10() { + return getHierarchyIdxCap(); + } + + @Override + public Integer value11() { + return getHierarchyIdxLen(); + } + + @Override + public UUID[] value12() { + return getItems(); + } + + @Override + public JSONB value13() { + return getFields(); + } + + @Override + public Integer value14() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value15() { + return getSysPeriodLower(); + } + + @Override + public Short value16() { + return getSysTenant(); + } + + @Override + public EhrFolderRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EhrFolderRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrFolderRecord value3(Integer value) { + setEhrFoldersIdx(value); + return this; + } + + @Override + public EhrFolderRecord value4(Integer value) { + setRowNum(value); + return this; + } + + @Override + public EhrFolderRecord value5(UUID value) { + setContributionId(value); + return this; + } + + @Override + public EhrFolderRecord value6(UUID value) { + setAuditId(value); + return this; + } + + @Override + public EhrFolderRecord value7(String value) { + setArchetypeNodeId(value); + return this; + } + + @Override + public EhrFolderRecord value8(String[] value) { + setPath(value); + return this; + } + + @Override + public EhrFolderRecord value9(String value) { + setHierarchyIdx(value); + return this; + } + + @Override + public EhrFolderRecord value10(String value) { + setHierarchyIdxCap(value); + return this; + } + + @Override + public EhrFolderRecord value11(Integer value) { + setHierarchyIdxLen(value); + return this; + } + + @Override + public EhrFolderRecord value12(UUID[] value) { + setItems(value); + return this; + } + + @Override + public EhrFolderRecord value13(JSONB value) { + setFields(value); + return this; + } + + @Override + public EhrFolderRecord value14(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrFolderRecord value15(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public EhrFolderRecord value16(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EhrFolderRecord values( + UUID value1, + UUID value2, + Integer value3, + Integer value4, + UUID value5, + UUID value6, + String value7, + String[] value8, + String value9, + String value10, + Integer value11, + UUID[] value12, + JSONB value13, + Integer value14, + OffsetDateTime value15, + Short value16) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + value16(value16); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrFolderRecord + */ + public EhrFolderRecord() { + super(EhrFolder.EHR_FOLDER); + } + + /** + * Create a detached, initialised EhrFolderRecord + */ + public EhrFolderRecord( + UUID id, + UUID ehrId, + Integer ehrFoldersIdx, + Integer rowNum, + UUID contributionId, + UUID auditId, + String archetypeNodeId, + String[] path, + String hierarchyIdx, + String hierarchyIdxCap, + Integer hierarchyIdxLen, + UUID[] items, + JSONB fields, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + Short sysTenant) { + super(EhrFolder.EHR_FOLDER); + + setId(id); + setEhrId(ehrId); + setEhrFoldersIdx(ehrFoldersIdx); + setRowNum(rowNum); + setContributionId(contributionId); + setAuditId(auditId); + setArchetypeNodeId(archetypeNodeId); + setPath(path); + setHierarchyIdx(hierarchyIdx); + setHierarchyIdxCap(hierarchyIdxCap); + setHierarchyIdxLen(hierarchyIdxLen); + setItems(items); + setFields(fields); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrRecord.java new file mode 100644 index 0000000..51b540f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrRecord.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Ehr; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * EHR itself + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrRecord extends UpdatableRecordImpl + implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr.date_created. + */ + public void setDateCreated(Timestamp value) { + set(1, value); + } + + /** + * Getter for ehr.ehr.date_created. + */ + public Timestamp getDateCreated() { + return (Timestamp) get(1); + } + + /** + * Setter for ehr.ehr.date_created_tzid. + */ + public void setDateCreatedTzid(String value) { + set(2, value); + } + + /** + * Getter for ehr.ehr.date_created_tzid. + */ + public String getDateCreatedTzid() { + return (String) get(2); + } + + /** + * Setter for ehr.ehr.access. + */ + public void setAccess(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.ehr.access. + */ + public UUID getAccess() { + return (UUID) get(3); + } + + /** + * Setter for ehr.ehr.system_id. + */ + public void setSystemId(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.ehr.system_id. + */ + public UUID getSystemId() { + return (UUID) get(4); + } + + /** + * Setter for ehr.ehr.sys_tenant. + */ + public void setSysTenant(Short value) { + set(5, value); + } + + /** + * Getter for ehr.ehr.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return Ehr.EHR_.ID; + } + + @Override + public Field field2() { + return Ehr.EHR_.DATE_CREATED; + } + + @Override + public Field field3() { + return Ehr.EHR_.DATE_CREATED_TZID; + } + + @Override + public Field field4() { + return Ehr.EHR_.ACCESS; + } + + @Override + public Field field5() { + return Ehr.EHR_.SYSTEM_ID; + } + + @Override + public Field field6() { + return Ehr.EHR_.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public Timestamp component2() { + return getDateCreated(); + } + + @Override + public String component3() { + return getDateCreatedTzid(); + } + + @Override + public UUID component4() { + return getAccess(); + } + + @Override + public UUID component5() { + return getSystemId(); + } + + @Override + public Short component6() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public Timestamp value2() { + return getDateCreated(); + } + + @Override + public String value3() { + return getDateCreatedTzid(); + } + + @Override + public UUID value4() { + return getAccess(); + } + + @Override + public UUID value5() { + return getSystemId(); + } + + @Override + public Short value6() { + return getSysTenant(); + } + + @Override + public EhrRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EhrRecord value2(Timestamp value) { + setDateCreated(value); + return this; + } + + @Override + public EhrRecord value3(String value) { + setDateCreatedTzid(value); + return this; + } + + @Override + public EhrRecord value4(UUID value) { + setAccess(value); + return this; + } + + @Override + public EhrRecord value5(UUID value) { + setSystemId(value); + return this; + } + + @Override + public EhrRecord value6(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EhrRecord values(UUID value1, Timestamp value2, String value3, UUID value4, UUID value5, Short value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrRecord + */ + public EhrRecord() { + super(Ehr.EHR_); + } + + /** + * Create a detached, initialised EhrRecord + */ + public EhrRecord( + UUID id, Timestamp dateCreated, String dateCreatedTzid, UUID access, UUID systemId, Short sysTenant) { + super(Ehr.EHR_); + + setId(id); + setDateCreated(dateCreated); + setDateCreatedTzid(dateCreatedTzid); + setAccess(access); + setSystemId(systemId); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrStatusRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrStatusRecord.java new file mode 100644 index 0000000..0239ca0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EhrStatusRecord.java @@ -0,0 +1,503 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EhrStatus; +import org.jooq.Field; +import org.jooq.Record11; +import org.jooq.Row11; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EhrStatusRecord extends TableRecordImpl + implements Record11 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_status.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_status.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_status.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_status.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for ehr.ehr_status.ref. + */ + public void setRef(String value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_status.ref. + */ + public String getRef() { + return (String) get(2); + } + + /** + * Setter for ehr.ehr_status.scheme. + */ + public void setScheme(String value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_status.scheme. + */ + public String getScheme() { + return (String) get(3); + } + + /** + * Setter for ehr.ehr_status.namespace. + */ + public void setNamespace(String value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_status.namespace. + */ + public String getNamespace() { + return (String) get(4); + } + + /** + * Setter for ehr.ehr_status.type. + */ + public void setType(String value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_status.type. + */ + public String getType() { + return (String) get(5); + } + + /** + * Setter for ehr.ehr_status.id_value. + */ + public void setIdValue(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_status.id_value. + */ + public String getIdValue() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_status.issuer. + */ + public void setIssuer(String value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_status.issuer. + */ + public String getIssuer() { + return (String) get(7); + } + + /** + * Setter for ehr.ehr_status.assigner. + */ + public void setAssigner(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_status.assigner. + */ + public String getAssigner() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_status.type_name. + */ + public void setTypeName(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_status.type_name. + */ + public String getTypeName() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_status.party. + */ + public void setParty(UUID value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_status.party. + */ + public UUID getParty() { + return (UUID) get(10); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrStatus.EHR_STATUS.ID; + } + + @Override + public Field field2() { + return EhrStatus.EHR_STATUS.NAME; + } + + @Override + public Field field3() { + return EhrStatus.EHR_STATUS.REF; + } + + @Override + public Field field4() { + return EhrStatus.EHR_STATUS.SCHEME; + } + + @Override + public Field field5() { + return EhrStatus.EHR_STATUS.NAMESPACE; + } + + @Override + public Field field6() { + return EhrStatus.EHR_STATUS.TYPE; + } + + @Override + public Field field7() { + return EhrStatus.EHR_STATUS.ID_VALUE; + } + + @Override + public Field field8() { + return EhrStatus.EHR_STATUS.ISSUER; + } + + @Override + public Field field9() { + return EhrStatus.EHR_STATUS.ASSIGNER; + } + + @Override + public Field field10() { + return EhrStatus.EHR_STATUS.TYPE_NAME; + } + + @Override + public Field field11() { + return EhrStatus.EHR_STATUS.PARTY; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getRef(); + } + + @Override + public String component4() { + return getScheme(); + } + + @Override + public String component5() { + return getNamespace(); + } + + @Override + public String component6() { + return getType(); + } + + @Override + public String component7() { + return getIdValue(); + } + + @Override + public String component8() { + return getIssuer(); + } + + @Override + public String component9() { + return getAssigner(); + } + + @Override + public String component10() { + return getTypeName(); + } + + @Override + public UUID component11() { + return getParty(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getRef(); + } + + @Override + public String value4() { + return getScheme(); + } + + @Override + public String value5() { + return getNamespace(); + } + + @Override + public String value6() { + return getType(); + } + + @Override + public String value7() { + return getIdValue(); + } + + @Override + public String value8() { + return getIssuer(); + } + + @Override + public String value9() { + return getAssigner(); + } + + @Override + public String value10() { + return getTypeName(); + } + + @Override + public UUID value11() { + return getParty(); + } + + @Override + public EhrStatusRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EhrStatusRecord value2(String value) { + setName(value); + return this; + } + + @Override + public EhrStatusRecord value3(String value) { + setRef(value); + return this; + } + + @Override + public EhrStatusRecord value4(String value) { + setScheme(value); + return this; + } + + @Override + public EhrStatusRecord value5(String value) { + setNamespace(value); + return this; + } + + @Override + public EhrStatusRecord value6(String value) { + setType(value); + return this; + } + + @Override + public EhrStatusRecord value7(String value) { + setIdValue(value); + return this; + } + + @Override + public EhrStatusRecord value8(String value) { + setIssuer(value); + return this; + } + + @Override + public EhrStatusRecord value9(String value) { + setAssigner(value); + return this; + } + + @Override + public EhrStatusRecord value10(String value) { + setTypeName(value); + return this; + } + + @Override + public EhrStatusRecord value11(UUID value) { + setParty(value); + return this; + } + + @Override + public EhrStatusRecord values( + UUID value1, + String value2, + String value3, + String value4, + String value5, + String value6, + String value7, + String value8, + String value9, + String value10, + UUID value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrStatusRecord + */ + public EhrStatusRecord() { + super(EhrStatus.EHR_STATUS); + } + + /** + * Create a detached, initialised EhrStatusRecord + */ + public EhrStatusRecord( + UUID id, + String name, + String ref, + String scheme, + String namespace, + String type, + String idValue, + String issuer, + String assigner, + String typeName, + UUID party) { + super(EhrStatus.EHR_STATUS); + + setId(id); + setName(name); + setRef(ref); + setScheme(scheme); + setNamespace(namespace); + setType(type); + setIdValue(idValue); + setIssuer(issuer); + setAssigner(assigner); + setTypeName(typeName); + setParty(party); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryHistoryRecord.java new file mode 100644 index 0000000..caa8b1c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryHistoryRecord.java @@ -0,0 +1,669 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.EntryType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EntryHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record14; +import org.jooq.Row14; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EntryHistoryRecord extends TableRecordImpl + implements Record14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.entry_history.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.entry_history.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.entry_history.composition_id. + */ + public void setCompositionId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.entry_history.composition_id. + */ + public UUID getCompositionId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.entry_history.sequence. + */ + public void setSequence(Integer value) { + set(2, value); + } + + /** + * Getter for ehr.entry_history.sequence. + */ + public Integer getSequence() { + return (Integer) get(2); + } + + /** + * Setter for ehr.entry_history.item_type. + */ + public void setItemType(EntryType value) { + set(3, value); + } + + /** + * Getter for ehr.entry_history.item_type. + */ + public EntryType getItemType() { + return (EntryType) get(3); + } + + /** + * Setter for ehr.entry_history.template_id. + */ + public void setTemplateId(String value) { + set(4, value); + } + + /** + * Getter for ehr.entry_history.template_id. + */ + public String getTemplateId() { + return (String) get(4); + } + + /** + * Setter for ehr.entry_history.template_uuid. + */ + public void setTemplateUuid(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.entry_history.template_uuid. + */ + public UUID getTemplateUuid() { + return (UUID) get(5); + } + + /** + * Setter for ehr.entry_history.archetype_id. + */ + public void setArchetypeId(String value) { + set(6, value); + } + + /** + * Getter for ehr.entry_history.archetype_id. + */ + public String getArchetypeId() { + return (String) get(6); + } + + /** + * Setter for ehr.entry_history.category. + */ + public void setCategory(DvCodedTextRecord value) { + set(7, value); + } + + /** + * Getter for ehr.entry_history.category. + */ + public DvCodedTextRecord getCategory() { + return (DvCodedTextRecord) get(7); + } + + /** + * Setter for ehr.entry_history.entry. + */ + public void setEntry(JSONB value) { + set(8, value); + } + + /** + * Getter for ehr.entry_history.entry. + */ + public JSONB getEntry() { + return (JSONB) get(8); + } + + /** + * Setter for ehr.entry_history.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(9, value); + } + + /** + * Getter for ehr.entry_history.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(9); + } + + /** + * Setter for ehr.entry_history.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(10, value); + } + + /** + * Getter for ehr.entry_history.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(10); + } + + /** + * Setter for ehr.entry_history.rm_version. + */ + public void setRmVersion(String value) { + set(11, value); + } + + /** + * Getter for ehr.entry_history.rm_version. + */ + public String getRmVersion() { + return (String) get(11); + } + + /** + * Setter for ehr.entry_history.name. + */ + public void setName(DvCodedTextRecord value) { + set(12, value); + } + + /** + * Getter for ehr.entry_history.name. + */ + public DvCodedTextRecord getName() { + return (DvCodedTextRecord) get(12); + } + + /** + * Setter for ehr.entry_history.sys_tenant. + */ + public void setSysTenant(Short value) { + set(13, value); + } + + /** + * Getter for ehr.entry_history.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(13); + } + + // ------------------------------------------------------------------------- + // Record14 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + @Override + public Row14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> + valuesRow() { + return (Row14) super.valuesRow(); + } + + @Override + public Field field1() { + return EntryHistory.ENTRY_HISTORY.ID; + } + + @Override + public Field field2() { + return EntryHistory.ENTRY_HISTORY.COMPOSITION_ID; + } + + @Override + public Field field3() { + return EntryHistory.ENTRY_HISTORY.SEQUENCE; + } + + @Override + public Field field4() { + return EntryHistory.ENTRY_HISTORY.ITEM_TYPE; + } + + @Override + public Field field5() { + return EntryHistory.ENTRY_HISTORY.TEMPLATE_ID; + } + + @Override + public Field field6() { + return EntryHistory.ENTRY_HISTORY.TEMPLATE_UUID; + } + + @Override + public Field field7() { + return EntryHistory.ENTRY_HISTORY.ARCHETYPE_ID; + } + + @Override + public Field field8() { + return EntryHistory.ENTRY_HISTORY.CATEGORY; + } + + @Override + public Field field9() { + return EntryHistory.ENTRY_HISTORY.ENTRY; + } + + @Override + public Field field10() { + return EntryHistory.ENTRY_HISTORY.SYS_TRANSACTION; + } + + @Override + public Field> field11() { + return EntryHistory.ENTRY_HISTORY.SYS_PERIOD; + } + + @Override + public Field field12() { + return EntryHistory.ENTRY_HISTORY.RM_VERSION; + } + + @Override + public Field field13() { + return EntryHistory.ENTRY_HISTORY.NAME; + } + + @Override + public Field field14() { + return EntryHistory.ENTRY_HISTORY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getCompositionId(); + } + + @Override + public Integer component3() { + return getSequence(); + } + + @Override + public EntryType component4() { + return getItemType(); + } + + @Override + public String component5() { + return getTemplateId(); + } + + @Override + public UUID component6() { + return getTemplateUuid(); + } + + @Override + public String component7() { + return getArchetypeId(); + } + + @Override + public DvCodedTextRecord component8() { + return getCategory(); + } + + @Override + public JSONB component9() { + return getEntry(); + } + + @Override + public Timestamp component10() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component11() { + return getSysPeriod(); + } + + @Override + public String component12() { + return getRmVersion(); + } + + @Override + public DvCodedTextRecord component13() { + return getName(); + } + + @Override + public Short component14() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getCompositionId(); + } + + @Override + public Integer value3() { + return getSequence(); + } + + @Override + public EntryType value4() { + return getItemType(); + } + + @Override + public String value5() { + return getTemplateId(); + } + + @Override + public UUID value6() { + return getTemplateUuid(); + } + + @Override + public String value7() { + return getArchetypeId(); + } + + @Override + public DvCodedTextRecord value8() { + return getCategory(); + } + + @Override + public JSONB value9() { + return getEntry(); + } + + @Override + public Timestamp value10() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value11() { + return getSysPeriod(); + } + + @Override + public String value12() { + return getRmVersion(); + } + + @Override + public DvCodedTextRecord value13() { + return getName(); + } + + @Override + public Short value14() { + return getSysTenant(); + } + + @Override + public EntryHistoryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EntryHistoryRecord value2(UUID value) { + setCompositionId(value); + return this; + } + + @Override + public EntryHistoryRecord value3(Integer value) { + setSequence(value); + return this; + } + + @Override + public EntryHistoryRecord value4(EntryType value) { + setItemType(value); + return this; + } + + @Override + public EntryHistoryRecord value5(String value) { + setTemplateId(value); + return this; + } + + @Override + public EntryHistoryRecord value6(UUID value) { + setTemplateUuid(value); + return this; + } + + @Override + public EntryHistoryRecord value7(String value) { + setArchetypeId(value); + return this; + } + + @Override + public EntryHistoryRecord value8(DvCodedTextRecord value) { + setCategory(value); + return this; + } + + @Override + public EntryHistoryRecord value9(JSONB value) { + setEntry(value); + return this; + } + + @Override + public EntryHistoryRecord value10(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public EntryHistoryRecord value11(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public EntryHistoryRecord value12(String value) { + setRmVersion(value); + return this; + } + + @Override + public EntryHistoryRecord value13(DvCodedTextRecord value) { + setName(value); + return this; + } + + @Override + public EntryHistoryRecord value14(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EntryHistoryRecord values( + UUID value1, + UUID value2, + Integer value3, + EntryType value4, + String value5, + UUID value6, + String value7, + DvCodedTextRecord value8, + JSONB value9, + Timestamp value10, + SimpleEntry value11, + String value12, + DvCodedTextRecord value13, + Short value14) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EntryHistoryRecord + */ + public EntryHistoryRecord() { + super(EntryHistory.ENTRY_HISTORY); + } + + /** + * Create a detached, initialised EntryHistoryRecord + */ + public EntryHistoryRecord( + UUID id, + UUID compositionId, + Integer sequence, + EntryType itemType, + String templateId, + UUID templateUuid, + String archetypeId, + DvCodedTextRecord category, + JSONB entry, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + String rmVersion, + DvCodedTextRecord name, + Short sysTenant) { + super(EntryHistory.ENTRY_HISTORY); + + setId(id); + setCompositionId(compositionId); + setSequence(sequence); + setItemType(itemType); + setTemplateId(templateId); + setTemplateUuid(templateUuid); + setArchetypeId(archetypeId); + setCategory(category); + setEntry(entry); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setRmVersion(rmVersion); + setName(name); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryRecord.java new file mode 100644 index 0000000..80e8e04 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EntryRecord.java @@ -0,0 +1,679 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.EntryType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Entry; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record14; +import org.jooq.Record2; +import org.jooq.Row14; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * this table hold the actual archetyped data values (fromBinder a template) + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EntryRecord extends UpdatableRecordImpl + implements Record14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.entry.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.entry.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.entry.composition_id. + */ + public void setCompositionId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.entry.composition_id. + */ + public UUID getCompositionId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.entry.sequence. + */ + public void setSequence(Integer value) { + set(2, value); + } + + /** + * Getter for ehr.entry.sequence. + */ + public Integer getSequence() { + return (Integer) get(2); + } + + /** + * Setter for ehr.entry.item_type. + */ + public void setItemType(EntryType value) { + set(3, value); + } + + /** + * Getter for ehr.entry.item_type. + */ + public EntryType getItemType() { + return (EntryType) get(3); + } + + /** + * Setter for ehr.entry.template_id. + */ + public void setTemplateId(String value) { + set(4, value); + } + + /** + * Getter for ehr.entry.template_id. + */ + public String getTemplateId() { + return (String) get(4); + } + + /** + * Setter for ehr.entry.template_uuid. + */ + public void setTemplateUuid(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.entry.template_uuid. + */ + public UUID getTemplateUuid() { + return (UUID) get(5); + } + + /** + * Setter for ehr.entry.archetype_id. + */ + public void setArchetypeId(String value) { + set(6, value); + } + + /** + * Getter for ehr.entry.archetype_id. + */ + public String getArchetypeId() { + return (String) get(6); + } + + /** + * Setter for ehr.entry.category. + */ + public void setCategory(DvCodedTextRecord value) { + set(7, value); + } + + /** + * Getter for ehr.entry.category. + */ + public DvCodedTextRecord getCategory() { + return (DvCodedTextRecord) get(7); + } + + /** + * Setter for ehr.entry.entry. + */ + public void setEntry(JSONB value) { + set(8, value); + } + + /** + * Getter for ehr.entry.entry. + */ + public JSONB getEntry() { + return (JSONB) get(8); + } + + /** + * Setter for ehr.entry.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(9, value); + } + + /** + * Getter for ehr.entry.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(9); + } + + /** + * Setter for ehr.entry.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(10, value); + } + + /** + * Getter for ehr.entry.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(10); + } + + /** + * Setter for ehr.entry.rm_version. + */ + public void setRmVersion(String value) { + set(11, value); + } + + /** + * Getter for ehr.entry.rm_version. + */ + public String getRmVersion() { + return (String) get(11); + } + + /** + * Setter for ehr.entry.name. + */ + public void setName(DvCodedTextRecord value) { + set(12, value); + } + + /** + * Getter for ehr.entry.name. + */ + public DvCodedTextRecord getName() { + return (DvCodedTextRecord) get(12); + } + + /** + * Setter for ehr.entry.sys_tenant. + */ + public void setSysTenant(Short value) { + set(13, value); + } + + /** + * Getter for ehr.entry.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(13); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record14 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + @Override + public Row14< + UUID, + UUID, + Integer, + EntryType, + String, + UUID, + String, + DvCodedTextRecord, + JSONB, + Timestamp, + SimpleEntry, + String, + DvCodedTextRecord, + Short> + valuesRow() { + return (Row14) super.valuesRow(); + } + + @Override + public Field field1() { + return Entry.ENTRY.ID; + } + + @Override + public Field field2() { + return Entry.ENTRY.COMPOSITION_ID; + } + + @Override + public Field field3() { + return Entry.ENTRY.SEQUENCE; + } + + @Override + public Field field4() { + return Entry.ENTRY.ITEM_TYPE; + } + + @Override + public Field field5() { + return Entry.ENTRY.TEMPLATE_ID; + } + + @Override + public Field field6() { + return Entry.ENTRY.TEMPLATE_UUID; + } + + @Override + public Field field7() { + return Entry.ENTRY.ARCHETYPE_ID; + } + + @Override + public Field field8() { + return Entry.ENTRY.CATEGORY; + } + + @Override + public Field field9() { + return Entry.ENTRY.ENTRY_; + } + + @Override + public Field field10() { + return Entry.ENTRY.SYS_TRANSACTION; + } + + @Override + public Field> field11() { + return Entry.ENTRY.SYS_PERIOD; + } + + @Override + public Field field12() { + return Entry.ENTRY.RM_VERSION; + } + + @Override + public Field field13() { + return Entry.ENTRY.NAME; + } + + @Override + public Field field14() { + return Entry.ENTRY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getCompositionId(); + } + + @Override + public Integer component3() { + return getSequence(); + } + + @Override + public EntryType component4() { + return getItemType(); + } + + @Override + public String component5() { + return getTemplateId(); + } + + @Override + public UUID component6() { + return getTemplateUuid(); + } + + @Override + public String component7() { + return getArchetypeId(); + } + + @Override + public DvCodedTextRecord component8() { + return getCategory(); + } + + @Override + public JSONB component9() { + return getEntry(); + } + + @Override + public Timestamp component10() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component11() { + return getSysPeriod(); + } + + @Override + public String component12() { + return getRmVersion(); + } + + @Override + public DvCodedTextRecord component13() { + return getName(); + } + + @Override + public Short component14() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getCompositionId(); + } + + @Override + public Integer value3() { + return getSequence(); + } + + @Override + public EntryType value4() { + return getItemType(); + } + + @Override + public String value5() { + return getTemplateId(); + } + + @Override + public UUID value6() { + return getTemplateUuid(); + } + + @Override + public String value7() { + return getArchetypeId(); + } + + @Override + public DvCodedTextRecord value8() { + return getCategory(); + } + + @Override + public JSONB value9() { + return getEntry(); + } + + @Override + public Timestamp value10() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value11() { + return getSysPeriod(); + } + + @Override + public String value12() { + return getRmVersion(); + } + + @Override + public DvCodedTextRecord value13() { + return getName(); + } + + @Override + public Short value14() { + return getSysTenant(); + } + + @Override + public EntryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EntryRecord value2(UUID value) { + setCompositionId(value); + return this; + } + + @Override + public EntryRecord value3(Integer value) { + setSequence(value); + return this; + } + + @Override + public EntryRecord value4(EntryType value) { + setItemType(value); + return this; + } + + @Override + public EntryRecord value5(String value) { + setTemplateId(value); + return this; + } + + @Override + public EntryRecord value6(UUID value) { + setTemplateUuid(value); + return this; + } + + @Override + public EntryRecord value7(String value) { + setArchetypeId(value); + return this; + } + + @Override + public EntryRecord value8(DvCodedTextRecord value) { + setCategory(value); + return this; + } + + @Override + public EntryRecord value9(JSONB value) { + setEntry(value); + return this; + } + + @Override + public EntryRecord value10(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public EntryRecord value11(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public EntryRecord value12(String value) { + setRmVersion(value); + return this; + } + + @Override + public EntryRecord value13(DvCodedTextRecord value) { + setName(value); + return this; + } + + @Override + public EntryRecord value14(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EntryRecord values( + UUID value1, + UUID value2, + Integer value3, + EntryType value4, + String value5, + UUID value6, + String value7, + DvCodedTextRecord value8, + JSONB value9, + Timestamp value10, + SimpleEntry value11, + String value12, + DvCodedTextRecord value13, + Short value14) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EntryRecord + */ + public EntryRecord() { + super(Entry.ENTRY); + } + + /** + * Create a detached, initialised EntryRecord + */ + public EntryRecord( + UUID id, + UUID compositionId, + Integer sequence, + EntryType itemType, + String templateId, + UUID templateUuid, + String archetypeId, + DvCodedTextRecord category, + JSONB entry, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + String rmVersion, + DvCodedTextRecord name, + Short sysTenant) { + super(Entry.ENTRY); + + setId(id); + setCompositionId(compositionId); + setSequence(sequence); + setItemType(itemType); + setTemplateId(templateId); + setTemplateUuid(templateUuid); + setArchetypeId(archetypeId); + setCategory(category); + setEntry(entry); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setRmVersion(rmVersion); + setName(name); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextHistoryRecord.java new file mode 100644 index 0000000..c0065cd --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextHistoryRecord.java @@ -0,0 +1,626 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContextHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record13; +import org.jooq.Row13; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EventContextHistoryRecord extends TableRecordImpl + implements Record13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.event_context_history.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.event_context_history.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.event_context_history.composition_id. + */ + public void setCompositionId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.event_context_history.composition_id. + */ + public UUID getCompositionId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.event_context_history.start_time. + */ + public void setStartTime(Timestamp value) { + set(2, value); + } + + /** + * Getter for ehr.event_context_history.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(2); + } + + /** + * Setter for ehr.event_context_history.start_time_tzid. + */ + public void setStartTimeTzid(String value) { + set(3, value); + } + + /** + * Getter for ehr.event_context_history.start_time_tzid. + */ + public String getStartTimeTzid() { + return (String) get(3); + } + + /** + * Setter for ehr.event_context_history.end_time. + */ + public void setEndTime(Timestamp value) { + set(4, value); + } + + /** + * Getter for ehr.event_context_history.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(4); + } + + /** + * Setter for ehr.event_context_history.end_time_tzid. + */ + public void setEndTimeTzid(String value) { + set(5, value); + } + + /** + * Getter for ehr.event_context_history.end_time_tzid. + */ + public String getEndTimeTzid() { + return (String) get(5); + } + + /** + * Setter for ehr.event_context_history.facility. + */ + public void setFacility(UUID value) { + set(6, value); + } + + /** + * Getter for ehr.event_context_history.facility. + */ + public UUID getFacility() { + return (UUID) get(6); + } + + /** + * Setter for ehr.event_context_history.location. + */ + public void setLocation(String value) { + set(7, value); + } + + /** + * Getter for ehr.event_context_history.location. + */ + public String getLocation() { + return (String) get(7); + } + + /** + * Setter for ehr.event_context_history.other_context. + */ + public void setOtherContext(JSONB value) { + set(8, value); + } + + /** + * Getter for ehr.event_context_history.other_context. + */ + public JSONB getOtherContext() { + return (JSONB) get(8); + } + + /** + * Setter for ehr.event_context_history.setting. + */ + public void setSetting(DvCodedTextRecord value) { + set(9, value); + } + + /** + * Getter for ehr.event_context_history.setting. + */ + public DvCodedTextRecord getSetting() { + return (DvCodedTextRecord) get(9); + } + + /** + * Setter for ehr.event_context_history.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(10, value); + } + + /** + * Getter for ehr.event_context_history.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(10); + } + + /** + * Setter for ehr.event_context_history.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(11, value); + } + + /** + * Getter for ehr.event_context_history.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(11); + } + + /** + * Setter for ehr.event_context_history.sys_tenant. + */ + public void setSysTenant(Short value) { + set(12, value); + } + + /** + * Getter for ehr.event_context_history.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(12); + } + + // ------------------------------------------------------------------------- + // Record13 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> + fieldsRow() { + return (Row13) super.fieldsRow(); + } + + @Override + public Row13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> + valuesRow() { + return (Row13) super.valuesRow(); + } + + @Override + public Field field1() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.ID; + } + + @Override + public Field field2() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.COMPOSITION_ID; + } + + @Override + public Field field3() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.START_TIME; + } + + @Override + public Field field4() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.START_TIME_TZID; + } + + @Override + public Field field5() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.END_TIME; + } + + @Override + public Field field6() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.END_TIME_TZID; + } + + @Override + public Field field7() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.FACILITY; + } + + @Override + public Field field8() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.LOCATION; + } + + @Override + public Field field9() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.OTHER_CONTEXT; + } + + @Override + public Field field10() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.SETTING; + } + + @Override + public Field field11() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.SYS_TRANSACTION; + } + + @Override + public Field> field12() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.SYS_PERIOD; + } + + @Override + public Field field13() { + return EventContextHistory.EVENT_CONTEXT_HISTORY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getCompositionId(); + } + + @Override + public Timestamp component3() { + return getStartTime(); + } + + @Override + public String component4() { + return getStartTimeTzid(); + } + + @Override + public Timestamp component5() { + return getEndTime(); + } + + @Override + public String component6() { + return getEndTimeTzid(); + } + + @Override + public UUID component7() { + return getFacility(); + } + + @Override + public String component8() { + return getLocation(); + } + + @Override + public JSONB component9() { + return getOtherContext(); + } + + @Override + public DvCodedTextRecord component10() { + return getSetting(); + } + + @Override + public Timestamp component11() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component12() { + return getSysPeriod(); + } + + @Override + public Short component13() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getCompositionId(); + } + + @Override + public Timestamp value3() { + return getStartTime(); + } + + @Override + public String value4() { + return getStartTimeTzid(); + } + + @Override + public Timestamp value5() { + return getEndTime(); + } + + @Override + public String value6() { + return getEndTimeTzid(); + } + + @Override + public UUID value7() { + return getFacility(); + } + + @Override + public String value8() { + return getLocation(); + } + + @Override + public JSONB value9() { + return getOtherContext(); + } + + @Override + public DvCodedTextRecord value10() { + return getSetting(); + } + + @Override + public Timestamp value11() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value12() { + return getSysPeriod(); + } + + @Override + public Short value13() { + return getSysTenant(); + } + + @Override + public EventContextHistoryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EventContextHistoryRecord value2(UUID value) { + setCompositionId(value); + return this; + } + + @Override + public EventContextHistoryRecord value3(Timestamp value) { + setStartTime(value); + return this; + } + + @Override + public EventContextHistoryRecord value4(String value) { + setStartTimeTzid(value); + return this; + } + + @Override + public EventContextHistoryRecord value5(Timestamp value) { + setEndTime(value); + return this; + } + + @Override + public EventContextHistoryRecord value6(String value) { + setEndTimeTzid(value); + return this; + } + + @Override + public EventContextHistoryRecord value7(UUID value) { + setFacility(value); + return this; + } + + @Override + public EventContextHistoryRecord value8(String value) { + setLocation(value); + return this; + } + + @Override + public EventContextHistoryRecord value9(JSONB value) { + setOtherContext(value); + return this; + } + + @Override + public EventContextHistoryRecord value10(DvCodedTextRecord value) { + setSetting(value); + return this; + } + + @Override + public EventContextHistoryRecord value11(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public EventContextHistoryRecord value12(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public EventContextHistoryRecord value13(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EventContextHistoryRecord values( + UUID value1, + UUID value2, + Timestamp value3, + String value4, + Timestamp value5, + String value6, + UUID value7, + String value8, + JSONB value9, + DvCodedTextRecord value10, + Timestamp value11, + SimpleEntry value12, + Short value13) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EventContextHistoryRecord + */ + public EventContextHistoryRecord() { + super(EventContextHistory.EVENT_CONTEXT_HISTORY); + } + + /** + * Create a detached, initialised EventContextHistoryRecord + */ + public EventContextHistoryRecord( + UUID id, + UUID compositionId, + Timestamp startTime, + String startTimeTzid, + Timestamp endTime, + String endTimeTzid, + UUID facility, + String location, + JSONB otherContext, + DvCodedTextRecord setting, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + Short sysTenant) { + super(EventContextHistory.EVENT_CONTEXT_HISTORY); + + setId(id); + setCompositionId(compositionId); + setStartTime(startTime); + setStartTimeTzid(startTimeTzid); + setEndTime(endTime); + setEndTimeTzid(endTimeTzid); + setFacility(facility); + setLocation(location); + setOtherContext(otherContext); + setSetting(setting); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextRecord.java new file mode 100644 index 0000000..2f9217b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/EventContextRecord.java @@ -0,0 +1,636 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.EventContext; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record13; +import org.jooq.Record2; +import org.jooq.Row13; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * defines the context of an event (time, who, where... see openEHR IM 5.2 + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class EventContextRecord extends UpdatableRecordImpl + implements Record13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.event_context.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.event_context.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.event_context.composition_id. + */ + public void setCompositionId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.event_context.composition_id. + */ + public UUID getCompositionId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.event_context.start_time. + */ + public void setStartTime(Timestamp value) { + set(2, value); + } + + /** + * Getter for ehr.event_context.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(2); + } + + /** + * Setter for ehr.event_context.start_time_tzid. + */ + public void setStartTimeTzid(String value) { + set(3, value); + } + + /** + * Getter for ehr.event_context.start_time_tzid. + */ + public String getStartTimeTzid() { + return (String) get(3); + } + + /** + * Setter for ehr.event_context.end_time. + */ + public void setEndTime(Timestamp value) { + set(4, value); + } + + /** + * Getter for ehr.event_context.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(4); + } + + /** + * Setter for ehr.event_context.end_time_tzid. + */ + public void setEndTimeTzid(String value) { + set(5, value); + } + + /** + * Getter for ehr.event_context.end_time_tzid. + */ + public String getEndTimeTzid() { + return (String) get(5); + } + + /** + * Setter for ehr.event_context.facility. + */ + public void setFacility(UUID value) { + set(6, value); + } + + /** + * Getter for ehr.event_context.facility. + */ + public UUID getFacility() { + return (UUID) get(6); + } + + /** + * Setter for ehr.event_context.location. + */ + public void setLocation(String value) { + set(7, value); + } + + /** + * Getter for ehr.event_context.location. + */ + public String getLocation() { + return (String) get(7); + } + + /** + * Setter for ehr.event_context.other_context. + */ + public void setOtherContext(JSONB value) { + set(8, value); + } + + /** + * Getter for ehr.event_context.other_context. + */ + public JSONB getOtherContext() { + return (JSONB) get(8); + } + + /** + * Setter for ehr.event_context.setting. + */ + public void setSetting(DvCodedTextRecord value) { + set(9, value); + } + + /** + * Getter for ehr.event_context.setting. + */ + public DvCodedTextRecord getSetting() { + return (DvCodedTextRecord) get(9); + } + + /** + * Setter for ehr.event_context.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(10, value); + } + + /** + * Getter for ehr.event_context.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(10); + } + + /** + * Setter for ehr.event_context.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(11, value); + } + + /** + * Getter for ehr.event_context.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(11); + } + + /** + * Setter for ehr.event_context.sys_tenant. + */ + public void setSysTenant(Short value) { + set(12, value); + } + + /** + * Getter for ehr.event_context.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(12); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record13 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> + fieldsRow() { + return (Row13) super.fieldsRow(); + } + + @Override + public Row13< + UUID, + UUID, + Timestamp, + String, + Timestamp, + String, + UUID, + String, + JSONB, + DvCodedTextRecord, + Timestamp, + SimpleEntry, + Short> + valuesRow() { + return (Row13) super.valuesRow(); + } + + @Override + public Field field1() { + return EventContext.EVENT_CONTEXT.ID; + } + + @Override + public Field field2() { + return EventContext.EVENT_CONTEXT.COMPOSITION_ID; + } + + @Override + public Field field3() { + return EventContext.EVENT_CONTEXT.START_TIME; + } + + @Override + public Field field4() { + return EventContext.EVENT_CONTEXT.START_TIME_TZID; + } + + @Override + public Field field5() { + return EventContext.EVENT_CONTEXT.END_TIME; + } + + @Override + public Field field6() { + return EventContext.EVENT_CONTEXT.END_TIME_TZID; + } + + @Override + public Field field7() { + return EventContext.EVENT_CONTEXT.FACILITY; + } + + @Override + public Field field8() { + return EventContext.EVENT_CONTEXT.LOCATION; + } + + @Override + public Field field9() { + return EventContext.EVENT_CONTEXT.OTHER_CONTEXT; + } + + @Override + public Field field10() { + return EventContext.EVENT_CONTEXT.SETTING; + } + + @Override + public Field field11() { + return EventContext.EVENT_CONTEXT.SYS_TRANSACTION; + } + + @Override + public Field> field12() { + return EventContext.EVENT_CONTEXT.SYS_PERIOD; + } + + @Override + public Field field13() { + return EventContext.EVENT_CONTEXT.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getCompositionId(); + } + + @Override + public Timestamp component3() { + return getStartTime(); + } + + @Override + public String component4() { + return getStartTimeTzid(); + } + + @Override + public Timestamp component5() { + return getEndTime(); + } + + @Override + public String component6() { + return getEndTimeTzid(); + } + + @Override + public UUID component7() { + return getFacility(); + } + + @Override + public String component8() { + return getLocation(); + } + + @Override + public JSONB component9() { + return getOtherContext(); + } + + @Override + public DvCodedTextRecord component10() { + return getSetting(); + } + + @Override + public Timestamp component11() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component12() { + return getSysPeriod(); + } + + @Override + public Short component13() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getCompositionId(); + } + + @Override + public Timestamp value3() { + return getStartTime(); + } + + @Override + public String value4() { + return getStartTimeTzid(); + } + + @Override + public Timestamp value5() { + return getEndTime(); + } + + @Override + public String value6() { + return getEndTimeTzid(); + } + + @Override + public UUID value7() { + return getFacility(); + } + + @Override + public String value8() { + return getLocation(); + } + + @Override + public JSONB value9() { + return getOtherContext(); + } + + @Override + public DvCodedTextRecord value10() { + return getSetting(); + } + + @Override + public Timestamp value11() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value12() { + return getSysPeriod(); + } + + @Override + public Short value13() { + return getSysTenant(); + } + + @Override + public EventContextRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EventContextRecord value2(UUID value) { + setCompositionId(value); + return this; + } + + @Override + public EventContextRecord value3(Timestamp value) { + setStartTime(value); + return this; + } + + @Override + public EventContextRecord value4(String value) { + setStartTimeTzid(value); + return this; + } + + @Override + public EventContextRecord value5(Timestamp value) { + setEndTime(value); + return this; + } + + @Override + public EventContextRecord value6(String value) { + setEndTimeTzid(value); + return this; + } + + @Override + public EventContextRecord value7(UUID value) { + setFacility(value); + return this; + } + + @Override + public EventContextRecord value8(String value) { + setLocation(value); + return this; + } + + @Override + public EventContextRecord value9(JSONB value) { + setOtherContext(value); + return this; + } + + @Override + public EventContextRecord value10(DvCodedTextRecord value) { + setSetting(value); + return this; + } + + @Override + public EventContextRecord value11(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public EventContextRecord value12(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public EventContextRecord value13(Short value) { + setSysTenant(value); + return this; + } + + @Override + public EventContextRecord values( + UUID value1, + UUID value2, + Timestamp value3, + String value4, + Timestamp value5, + String value6, + UUID value7, + String value8, + JSONB value9, + DvCodedTextRecord value10, + Timestamp value11, + SimpleEntry value12, + Short value13) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EventContextRecord + */ + public EventContextRecord() { + super(EventContext.EVENT_CONTEXT); + } + + /** + * Create a detached, initialised EventContextRecord + */ + public EventContextRecord( + UUID id, + UUID compositionId, + Timestamp startTime, + String startTimeTzid, + Timestamp endTime, + String endTimeTzid, + UUID facility, + String location, + JSONB otherContext, + DvCodedTextRecord setting, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + Short sysTenant) { + super(EventContext.EVENT_CONTEXT); + + setId(id); + setCompositionId(compositionId); + setStartTime(startTime); + setStartTimeTzid(startTimeTzid); + setEndTime(endTime); + setEndTimeTzid(endTimeTzid); + setFacility(facility); + setLocation(location); + setOtherContext(otherContext); + setSetting(setting); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java new file mode 100644 index 0000000..7db85a3 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.FlywaySchemaHistory; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record10; +import org.jooq.Row10; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class FlywaySchemaHistoryRecord extends UpdatableRecordImpl + implements Record10 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.flyway_schema_history.installed_rank. + */ + public void setInstalledRank(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.flyway_schema_history.installed_rank. + */ + public Integer getInstalledRank() { + return (Integer) get(0); + } + + /** + * Setter for ehr.flyway_schema_history.version. + */ + public void setVersion(String value) { + set(1, value); + } + + /** + * Getter for ehr.flyway_schema_history.version. + */ + public String getVersion() { + return (String) get(1); + } + + /** + * Setter for ehr.flyway_schema_history.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for ehr.flyway_schema_history.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for ehr.flyway_schema_history.type. + */ + public void setType(String value) { + set(3, value); + } + + /** + * Getter for ehr.flyway_schema_history.type. + */ + public String getType() { + return (String) get(3); + } + + /** + * Setter for ehr.flyway_schema_history.script. + */ + public void setScript(String value) { + set(4, value); + } + + /** + * Getter for ehr.flyway_schema_history.script. + */ + public String getScript() { + return (String) get(4); + } + + /** + * Setter for ehr.flyway_schema_history.checksum. + */ + public void setChecksum(Integer value) { + set(5, value); + } + + /** + * Getter for ehr.flyway_schema_history.checksum. + */ + public Integer getChecksum() { + return (Integer) get(5); + } + + /** + * Setter for ehr.flyway_schema_history.installed_by. + */ + public void setInstalledBy(String value) { + set(6, value); + } + + /** + * Getter for ehr.flyway_schema_history.installed_by. + */ + public String getInstalledBy() { + return (String) get(6); + } + + /** + * Setter for ehr.flyway_schema_history.installed_on. + */ + public void setInstalledOn(Timestamp value) { + set(7, value); + } + + /** + * Getter for ehr.flyway_schema_history.installed_on. + */ + public Timestamp getInstalledOn() { + return (Timestamp) get(7); + } + + /** + * Setter for ehr.flyway_schema_history.execution_time. + */ + public void setExecutionTime(Integer value) { + set(8, value); + } + + /** + * Getter for ehr.flyway_schema_history.execution_time. + */ + public Integer getExecutionTime() { + return (Integer) get(8); + } + + /** + * Setter for ehr.flyway_schema_history.success. + */ + public void setSuccess(Boolean value) { + set(9, value); + } + + /** + * Getter for ehr.flyway_schema_history.success. + */ + public Boolean getSuccess() { + return (Boolean) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + @Override + public Row10 valuesRow() { + return (Row10) super.valuesRow(); + } + + @Override + public Field field1() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_RANK; + } + + @Override + public Field field2() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.VERSION; + } + + @Override + public Field field3() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.DESCRIPTION; + } + + @Override + public Field field4() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.TYPE; + } + + @Override + public Field field5() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SCRIPT; + } + + @Override + public Field field6() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.CHECKSUM; + } + + @Override + public Field field7() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_BY; + } + + @Override + public Field field8() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_ON; + } + + @Override + public Field field9() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.EXECUTION_TIME; + } + + @Override + public Field field10() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SUCCESS; + } + + @Override + public Integer component1() { + return getInstalledRank(); + } + + @Override + public String component2() { + return getVersion(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public String component4() { + return getType(); + } + + @Override + public String component5() { + return getScript(); + } + + @Override + public Integer component6() { + return getChecksum(); + } + + @Override + public String component7() { + return getInstalledBy(); + } + + @Override + public Timestamp component8() { + return getInstalledOn(); + } + + @Override + public Integer component9() { + return getExecutionTime(); + } + + @Override + public Boolean component10() { + return getSuccess(); + } + + @Override + public Integer value1() { + return getInstalledRank(); + } + + @Override + public String value2() { + return getVersion(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public String value4() { + return getType(); + } + + @Override + public String value5() { + return getScript(); + } + + @Override + public Integer value6() { + return getChecksum(); + } + + @Override + public String value7() { + return getInstalledBy(); + } + + @Override + public Timestamp value8() { + return getInstalledOn(); + } + + @Override + public Integer value9() { + return getExecutionTime(); + } + + @Override + public Boolean value10() { + return getSuccess(); + } + + @Override + public FlywaySchemaHistoryRecord value1(Integer value) { + setInstalledRank(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value2(String value) { + setVersion(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value4(String value) { + setType(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value5(String value) { + setScript(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value6(Integer value) { + setChecksum(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value7(String value) { + setInstalledBy(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value8(Timestamp value) { + setInstalledOn(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value9(Integer value) { + setExecutionTime(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value10(Boolean value) { + setSuccess(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord values( + Integer value1, + String value2, + String value3, + String value4, + String value5, + Integer value6, + String value7, + Timestamp value8, + Integer value9, + Boolean value10) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached FlywaySchemaHistoryRecord + */ + public FlywaySchemaHistoryRecord() { + super(FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY); + } + + /** + * Create a detached, initialised FlywaySchemaHistoryRecord + */ + public FlywaySchemaHistoryRecord( + Integer installedRank, + String version, + String description, + String type, + String script, + Integer checksum, + String installedBy, + Timestamp installedOn, + Integer executionTime, + Boolean success) { + super(FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY); + + setInstalledRank(installedRank); + setVersion(version); + setDescription(description); + setType(type); + setScript(script); + setChecksum(checksum); + setInstalledBy(installedBy); + setInstalledOn(installedOn); + setExecutionTime(executionTime); + setSuccess(success); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/HeadingRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/HeadingRecord.java new file mode 100644 index 0000000..2ed3535 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/HeadingRecord.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Heading; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class HeadingRecord extends UpdatableRecordImpl + implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.heading.code. + */ + public void setCode(String value) { + set(0, value); + } + + /** + * Getter for ehr.heading.code. + */ + public String getCode() { + return (String) get(0); + } + + /** + * Setter for ehr.heading.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for ehr.heading.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for ehr.heading.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for ehr.heading.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for ehr.heading.sys_tenant. + */ + public void setSysTenant(Short value) { + set(3, value); + } + + /** + * Getter for ehr.heading.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Heading.HEADING.CODE; + } + + @Override + public Field field2() { + return Heading.HEADING.NAME; + } + + @Override + public Field field3() { + return Heading.HEADING.DESCRIPTION; + } + + @Override + public Field field4() { + return Heading.HEADING.SYS_TENANT; + } + + @Override + public String component1() { + return getCode(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public Short component4() { + return getSysTenant(); + } + + @Override + public String value1() { + return getCode(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public Short value4() { + return getSysTenant(); + } + + @Override + public HeadingRecord value1(String value) { + setCode(value); + return this; + } + + @Override + public HeadingRecord value2(String value) { + setName(value); + return this; + } + + @Override + public HeadingRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public HeadingRecord value4(Short value) { + setSysTenant(value); + return this; + } + + @Override + public HeadingRecord values(String value1, String value2, String value3, Short value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached HeadingRecord + */ + public HeadingRecord() { + super(Heading.HEADING); + } + + /** + * Create a detached, initialised HeadingRecord + */ + public HeadingRecord(String code, String name, String description, Short sysTenant) { + super(Heading.HEADING); + + setCode(code); + setName(name); + setDescription(description); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/IdentifierRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/IdentifierRecord.java new file mode 100644 index 0000000..c9298bd --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/IdentifierRecord.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Identifier; +import org.jooq.Field; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.TableRecordImpl; + +/** + * specifies an identifier for a party identified, more than one identifier is + * possible + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class IdentifierRecord extends TableRecordImpl + implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.identifier.id_value. + */ + public void setIdValue(String value) { + set(0, value); + } + + /** + * Getter for ehr.identifier.id_value. + */ + public String getIdValue() { + return (String) get(0); + } + + /** + * Setter for ehr.identifier.issuer. + */ + public void setIssuer(String value) { + set(1, value); + } + + /** + * Getter for ehr.identifier.issuer. + */ + public String getIssuer() { + return (String) get(1); + } + + /** + * Setter for ehr.identifier.assigner. + */ + public void setAssigner(String value) { + set(2, value); + } + + /** + * Getter for ehr.identifier.assigner. + */ + public String getAssigner() { + return (String) get(2); + } + + /** + * Setter for ehr.identifier.type_name. + */ + public void setTypeName(String value) { + set(3, value); + } + + /** + * Getter for ehr.identifier.type_name. + */ + public String getTypeName() { + return (String) get(3); + } + + /** + * Setter for ehr.identifier.party. + */ + public void setParty(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.identifier.party. + */ + public UUID getParty() { + return (UUID) get(4); + } + + /** + * Setter for ehr.identifier.sys_tenant. + */ + public void setSysTenant(Short value) { + set(5, value); + } + + /** + * Getter for ehr.identifier.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return Identifier.IDENTIFIER.ID_VALUE; + } + + @Override + public Field field2() { + return Identifier.IDENTIFIER.ISSUER; + } + + @Override + public Field field3() { + return Identifier.IDENTIFIER.ASSIGNER; + } + + @Override + public Field field4() { + return Identifier.IDENTIFIER.TYPE_NAME; + } + + @Override + public Field field5() { + return Identifier.IDENTIFIER.PARTY; + } + + @Override + public Field field6() { + return Identifier.IDENTIFIER.SYS_TENANT; + } + + @Override + public String component1() { + return getIdValue(); + } + + @Override + public String component2() { + return getIssuer(); + } + + @Override + public String component3() { + return getAssigner(); + } + + @Override + public String component4() { + return getTypeName(); + } + + @Override + public UUID component5() { + return getParty(); + } + + @Override + public Short component6() { + return getSysTenant(); + } + + @Override + public String value1() { + return getIdValue(); + } + + @Override + public String value2() { + return getIssuer(); + } + + @Override + public String value3() { + return getAssigner(); + } + + @Override + public String value4() { + return getTypeName(); + } + + @Override + public UUID value5() { + return getParty(); + } + + @Override + public Short value6() { + return getSysTenant(); + } + + @Override + public IdentifierRecord value1(String value) { + setIdValue(value); + return this; + } + + @Override + public IdentifierRecord value2(String value) { + setIssuer(value); + return this; + } + + @Override + public IdentifierRecord value3(String value) { + setAssigner(value); + return this; + } + + @Override + public IdentifierRecord value4(String value) { + setTypeName(value); + return this; + } + + @Override + public IdentifierRecord value5(UUID value) { + setParty(value); + return this; + } + + @Override + public IdentifierRecord value6(Short value) { + setSysTenant(value); + return this; + } + + @Override + public IdentifierRecord values( + String value1, String value2, String value3, String value4, UUID value5, Short value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached IdentifierRecord + */ + public IdentifierRecord() { + super(Identifier.IDENTIFIER); + } + + /** + * Create a detached, initialised IdentifierRecord + */ + public IdentifierRecord( + String idValue, String issuer, String assigner, String typeName, UUID party, Short sysTenant) { + super(Identifier.IDENTIFIER); + + setIdValue(idValue); + setIssuer(issuer); + setAssigner(assigner); + setTypeName(typeName); + setParty(party); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/JsonbArrayElementsRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/JsonbArrayElementsRecord.java new file mode 100644 index 0000000..75da00a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/JsonbArrayElementsRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.JsonbArrayElements; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JsonbArrayElementsRecord extends TableRecordImpl implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.jsonb_array_elements.jsonb_array_elements. + */ + public void setJsonbArrayElements(JSONB value) { + set(0, value); + } + + /** + * Getter for ehr.jsonb_array_elements.jsonb_array_elements. + */ + public JSONB getJsonbArrayElements() { + return (JSONB) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return JsonbArrayElements.JSONB_ARRAY_ELEMENTS.JSONB_ARRAY_ELEMENTS_; + } + + @Override + public JSONB component1() { + return getJsonbArrayElements(); + } + + @Override + public JSONB value1() { + return getJsonbArrayElements(); + } + + @Override + public JsonbArrayElementsRecord value1(JSONB value) { + setJsonbArrayElements(value); + return this; + } + + @Override + public JsonbArrayElementsRecord values(JSONB value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JsonbArrayElementsRecord + */ + public JsonbArrayElementsRecord() { + super(JsonbArrayElements.JSONB_ARRAY_ELEMENTS); + } + + /** + * Create a detached, initialised JsonbArrayElementsRecord + */ + public JsonbArrayElementsRecord(JSONB jsonbArrayElements) { + super(JsonbArrayElements.JSONB_ARRAY_ELEMENTS); + + setJsonbArrayElements(jsonbArrayElements); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/LanguageRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/LanguageRecord.java new file mode 100644 index 0000000..b416b9b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/LanguageRecord.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Language; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * ISO 639-1 language codeset + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class LanguageRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.language.code. + */ + public void setCode(String value) { + set(0, value); + } + + /** + * Getter for ehr.language.code. + */ + public String getCode() { + return (String) get(0); + } + + /** + * Setter for ehr.language.description. + */ + public void setDescription(String value) { + set(1, value); + } + + /** + * Getter for ehr.language.description. + */ + public String getDescription() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return Language.LANGUAGE.CODE; + } + + @Override + public Field field2() { + return Language.LANGUAGE.DESCRIPTION; + } + + @Override + public String component1() { + return getCode(); + } + + @Override + public String component2() { + return getDescription(); + } + + @Override + public String value1() { + return getCode(); + } + + @Override + public String value2() { + return getDescription(); + } + + @Override + public LanguageRecord value1(String value) { + setCode(value); + return this; + } + + @Override + public LanguageRecord value2(String value) { + setDescription(value); + return this; + } + + @Override + public LanguageRecord values(String value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached LanguageRecord + */ + public LanguageRecord() { + super(Language.LANGUAGE); + } + + /** + * Create a detached, initialised LanguageRecord + */ + public LanguageRecord(String code, String description) { + super(Language.LANGUAGE); + + setCode(code); + setDescription(description); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationHistoryRecord.java new file mode 100644 index 0000000..78793f0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationHistoryRecord.java @@ -0,0 +1,583 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.ParticipationHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Record12; +import org.jooq.Row12; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class ParticipationHistoryRecord extends TableRecordImpl + implements Record12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.participation_history.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.participation_history.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.participation_history.event_context. + */ + public void setEventContext(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.participation_history.event_context. + */ + public UUID getEventContext() { + return (UUID) get(1); + } + + /** + * Setter for ehr.participation_history.performer. + */ + public void setPerformer(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.participation_history.performer. + */ + public UUID getPerformer() { + return (UUID) get(2); + } + + /** + * Setter for ehr.participation_history.function. + */ + public void setFunction(DvCodedTextRecord value) { + set(3, value); + } + + /** + * Getter for ehr.participation_history.function. + */ + public DvCodedTextRecord getFunction() { + return (DvCodedTextRecord) get(3); + } + + /** + * Setter for ehr.participation_history.mode. + */ + public void setMode(DvCodedTextRecord value) { + set(4, value); + } + + /** + * Getter for ehr.participation_history.mode. + */ + public DvCodedTextRecord getMode() { + return (DvCodedTextRecord) get(4); + } + + /** + * Setter for ehr.participation_history.time_lower. + */ + public void setTimeLower(Timestamp value) { + set(5, value); + } + + /** + * Getter for ehr.participation_history.time_lower. + */ + public Timestamp getTimeLower() { + return (Timestamp) get(5); + } + + /** + * Setter for ehr.participation_history.time_lower_tz. + */ + public void setTimeLowerTz(String value) { + set(6, value); + } + + /** + * Getter for ehr.participation_history.time_lower_tz. + */ + public String getTimeLowerTz() { + return (String) get(6); + } + + /** + * Setter for ehr.participation_history.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(7, value); + } + + /** + * Getter for ehr.participation_history.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(7); + } + + /** + * Setter for ehr.participation_history.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(8, value); + } + + /** + * Getter for ehr.participation_history.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(8); + } + + /** + * Setter for ehr.participation_history.time_upper. + */ + public void setTimeUpper(Timestamp value) { + set(9, value); + } + + /** + * Getter for ehr.participation_history.time_upper. + */ + public Timestamp getTimeUpper() { + return (Timestamp) get(9); + } + + /** + * Setter for ehr.participation_history.time_upper_tz. + */ + public void setTimeUpperTz(String value) { + set(10, value); + } + + /** + * Getter for ehr.participation_history.time_upper_tz. + */ + public String getTimeUpperTz() { + return (String) get(10); + } + + /** + * Setter for ehr.participation_history.sys_tenant. + */ + public void setSysTenant(Short value) { + set(11, value); + } + + /** + * Getter for ehr.participation_history.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(11); + } + + // ------------------------------------------------------------------------- + // Record12 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> + fieldsRow() { + return (Row12) super.fieldsRow(); + } + + @Override + public Row12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> + valuesRow() { + return (Row12) super.valuesRow(); + } + + @Override + public Field field1() { + return ParticipationHistory.PARTICIPATION_HISTORY.ID; + } + + @Override + public Field field2() { + return ParticipationHistory.PARTICIPATION_HISTORY.EVENT_CONTEXT; + } + + @Override + public Field field3() { + return ParticipationHistory.PARTICIPATION_HISTORY.PERFORMER; + } + + @Override + public Field field4() { + return ParticipationHistory.PARTICIPATION_HISTORY.FUNCTION; + } + + @Override + public Field field5() { + return ParticipationHistory.PARTICIPATION_HISTORY.MODE; + } + + @Override + public Field field6() { + return ParticipationHistory.PARTICIPATION_HISTORY.TIME_LOWER; + } + + @Override + public Field field7() { + return ParticipationHistory.PARTICIPATION_HISTORY.TIME_LOWER_TZ; + } + + @Override + public Field field8() { + return ParticipationHistory.PARTICIPATION_HISTORY.SYS_TRANSACTION; + } + + @Override + public Field> field9() { + return ParticipationHistory.PARTICIPATION_HISTORY.SYS_PERIOD; + } + + @Override + public Field field10() { + return ParticipationHistory.PARTICIPATION_HISTORY.TIME_UPPER; + } + + @Override + public Field field11() { + return ParticipationHistory.PARTICIPATION_HISTORY.TIME_UPPER_TZ; + } + + @Override + public Field field12() { + return ParticipationHistory.PARTICIPATION_HISTORY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEventContext(); + } + + @Override + public UUID component3() { + return getPerformer(); + } + + @Override + public DvCodedTextRecord component4() { + return getFunction(); + } + + @Override + public DvCodedTextRecord component5() { + return getMode(); + } + + @Override + public Timestamp component6() { + return getTimeLower(); + } + + @Override + public String component7() { + return getTimeLowerTz(); + } + + @Override + public Timestamp component8() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component9() { + return getSysPeriod(); + } + + @Override + public Timestamp component10() { + return getTimeUpper(); + } + + @Override + public String component11() { + return getTimeUpperTz(); + } + + @Override + public Short component12() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEventContext(); + } + + @Override + public UUID value3() { + return getPerformer(); + } + + @Override + public DvCodedTextRecord value4() { + return getFunction(); + } + + @Override + public DvCodedTextRecord value5() { + return getMode(); + } + + @Override + public Timestamp value6() { + return getTimeLower(); + } + + @Override + public String value7() { + return getTimeLowerTz(); + } + + @Override + public Timestamp value8() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value9() { + return getSysPeriod(); + } + + @Override + public Timestamp value10() { + return getTimeUpper(); + } + + @Override + public String value11() { + return getTimeUpperTz(); + } + + @Override + public Short value12() { + return getSysTenant(); + } + + @Override + public ParticipationHistoryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public ParticipationHistoryRecord value2(UUID value) { + setEventContext(value); + return this; + } + + @Override + public ParticipationHistoryRecord value3(UUID value) { + setPerformer(value); + return this; + } + + @Override + public ParticipationHistoryRecord value4(DvCodedTextRecord value) { + setFunction(value); + return this; + } + + @Override + public ParticipationHistoryRecord value5(DvCodedTextRecord value) { + setMode(value); + return this; + } + + @Override + public ParticipationHistoryRecord value6(Timestamp value) { + setTimeLower(value); + return this; + } + + @Override + public ParticipationHistoryRecord value7(String value) { + setTimeLowerTz(value); + return this; + } + + @Override + public ParticipationHistoryRecord value8(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public ParticipationHistoryRecord value9(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public ParticipationHistoryRecord value10(Timestamp value) { + setTimeUpper(value); + return this; + } + + @Override + public ParticipationHistoryRecord value11(String value) { + setTimeUpperTz(value); + return this; + } + + @Override + public ParticipationHistoryRecord value12(Short value) { + setSysTenant(value); + return this; + } + + @Override + public ParticipationHistoryRecord values( + UUID value1, + UUID value2, + UUID value3, + DvCodedTextRecord value4, + DvCodedTextRecord value5, + Timestamp value6, + String value7, + Timestamp value8, + SimpleEntry value9, + Timestamp value10, + String value11, + Short value12) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ParticipationHistoryRecord + */ + public ParticipationHistoryRecord() { + super(ParticipationHistory.PARTICIPATION_HISTORY); + } + + /** + * Create a detached, initialised ParticipationHistoryRecord + */ + public ParticipationHistoryRecord( + UUID id, + UUID eventContext, + UUID performer, + DvCodedTextRecord function, + DvCodedTextRecord mode, + Timestamp timeLower, + String timeLowerTz, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + Timestamp timeUpper, + String timeUpperTz, + Short sysTenant) { + super(ParticipationHistory.PARTICIPATION_HISTORY); + + setId(id); + setEventContext(eventContext); + setPerformer(performer); + setFunction(function); + setMode(mode); + setTimeLower(timeLower); + setTimeLowerTz(timeLowerTz); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setTimeUpper(timeUpper); + setTimeUpperTz(timeUpperTz); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationRecord.java new file mode 100644 index 0000000..3f3f52e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/ParticipationRecord.java @@ -0,0 +1,593 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Participation; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Record12; +import org.jooq.Record2; +import org.jooq.Row12; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * define a participating party for an event f.ex. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class ParticipationRecord extends UpdatableRecordImpl + implements Record12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.participation.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.participation.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.participation.event_context. + */ + public void setEventContext(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.participation.event_context. + */ + public UUID getEventContext() { + return (UUID) get(1); + } + + /** + * Setter for ehr.participation.performer. + */ + public void setPerformer(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.participation.performer. + */ + public UUID getPerformer() { + return (UUID) get(2); + } + + /** + * Setter for ehr.participation.function. + */ + public void setFunction(DvCodedTextRecord value) { + set(3, value); + } + + /** + * Getter for ehr.participation.function. + */ + public DvCodedTextRecord getFunction() { + return (DvCodedTextRecord) get(3); + } + + /** + * Setter for ehr.participation.mode. + */ + public void setMode(DvCodedTextRecord value) { + set(4, value); + } + + /** + * Getter for ehr.participation.mode. + */ + public DvCodedTextRecord getMode() { + return (DvCodedTextRecord) get(4); + } + + /** + * Setter for ehr.participation.time_lower. + */ + public void setTimeLower(Timestamp value) { + set(5, value); + } + + /** + * Getter for ehr.participation.time_lower. + */ + public Timestamp getTimeLower() { + return (Timestamp) get(5); + } + + /** + * Setter for ehr.participation.time_lower_tz. + */ + public void setTimeLowerTz(String value) { + set(6, value); + } + + /** + * Getter for ehr.participation.time_lower_tz. + */ + public String getTimeLowerTz() { + return (String) get(6); + } + + /** + * Setter for ehr.participation.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(7, value); + } + + /** + * Getter for ehr.participation.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(7); + } + + /** + * Setter for ehr.participation.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(8, value); + } + + /** + * Getter for ehr.participation.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(8); + } + + /** + * Setter for ehr.participation.time_upper. + */ + public void setTimeUpper(Timestamp value) { + set(9, value); + } + + /** + * Getter for ehr.participation.time_upper. + */ + public Timestamp getTimeUpper() { + return (Timestamp) get(9); + } + + /** + * Setter for ehr.participation.time_upper_tz. + */ + public void setTimeUpperTz(String value) { + set(10, value); + } + + /** + * Getter for ehr.participation.time_upper_tz. + */ + public String getTimeUpperTz() { + return (String) get(10); + } + + /** + * Setter for ehr.participation.sys_tenant. + */ + public void setSysTenant(Short value) { + set(11, value); + } + + /** + * Getter for ehr.participation.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(11); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record12 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> + fieldsRow() { + return (Row12) super.fieldsRow(); + } + + @Override + public Row12< + UUID, + UUID, + UUID, + DvCodedTextRecord, + DvCodedTextRecord, + Timestamp, + String, + Timestamp, + SimpleEntry, + Timestamp, + String, + Short> + valuesRow() { + return (Row12) super.valuesRow(); + } + + @Override + public Field field1() { + return Participation.PARTICIPATION.ID; + } + + @Override + public Field field2() { + return Participation.PARTICIPATION.EVENT_CONTEXT; + } + + @Override + public Field field3() { + return Participation.PARTICIPATION.PERFORMER; + } + + @Override + public Field field4() { + return Participation.PARTICIPATION.FUNCTION; + } + + @Override + public Field field5() { + return Participation.PARTICIPATION.MODE; + } + + @Override + public Field field6() { + return Participation.PARTICIPATION.TIME_LOWER; + } + + @Override + public Field field7() { + return Participation.PARTICIPATION.TIME_LOWER_TZ; + } + + @Override + public Field field8() { + return Participation.PARTICIPATION.SYS_TRANSACTION; + } + + @Override + public Field> field9() { + return Participation.PARTICIPATION.SYS_PERIOD; + } + + @Override + public Field field10() { + return Participation.PARTICIPATION.TIME_UPPER; + } + + @Override + public Field field11() { + return Participation.PARTICIPATION.TIME_UPPER_TZ; + } + + @Override + public Field field12() { + return Participation.PARTICIPATION.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEventContext(); + } + + @Override + public UUID component3() { + return getPerformer(); + } + + @Override + public DvCodedTextRecord component4() { + return getFunction(); + } + + @Override + public DvCodedTextRecord component5() { + return getMode(); + } + + @Override + public Timestamp component6() { + return getTimeLower(); + } + + @Override + public String component7() { + return getTimeLowerTz(); + } + + @Override + public Timestamp component8() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component9() { + return getSysPeriod(); + } + + @Override + public Timestamp component10() { + return getTimeUpper(); + } + + @Override + public String component11() { + return getTimeUpperTz(); + } + + @Override + public Short component12() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEventContext(); + } + + @Override + public UUID value3() { + return getPerformer(); + } + + @Override + public DvCodedTextRecord value4() { + return getFunction(); + } + + @Override + public DvCodedTextRecord value5() { + return getMode(); + } + + @Override + public Timestamp value6() { + return getTimeLower(); + } + + @Override + public String value7() { + return getTimeLowerTz(); + } + + @Override + public Timestamp value8() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value9() { + return getSysPeriod(); + } + + @Override + public Timestamp value10() { + return getTimeUpper(); + } + + @Override + public String value11() { + return getTimeUpperTz(); + } + + @Override + public Short value12() { + return getSysTenant(); + } + + @Override + public ParticipationRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public ParticipationRecord value2(UUID value) { + setEventContext(value); + return this; + } + + @Override + public ParticipationRecord value3(UUID value) { + setPerformer(value); + return this; + } + + @Override + public ParticipationRecord value4(DvCodedTextRecord value) { + setFunction(value); + return this; + } + + @Override + public ParticipationRecord value5(DvCodedTextRecord value) { + setMode(value); + return this; + } + + @Override + public ParticipationRecord value6(Timestamp value) { + setTimeLower(value); + return this; + } + + @Override + public ParticipationRecord value7(String value) { + setTimeLowerTz(value); + return this; + } + + @Override + public ParticipationRecord value8(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public ParticipationRecord value9(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public ParticipationRecord value10(Timestamp value) { + setTimeUpper(value); + return this; + } + + @Override + public ParticipationRecord value11(String value) { + setTimeUpperTz(value); + return this; + } + + @Override + public ParticipationRecord value12(Short value) { + setSysTenant(value); + return this; + } + + @Override + public ParticipationRecord values( + UUID value1, + UUID value2, + UUID value3, + DvCodedTextRecord value4, + DvCodedTextRecord value5, + Timestamp value6, + String value7, + Timestamp value8, + SimpleEntry value9, + Timestamp value10, + String value11, + Short value12) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ParticipationRecord + */ + public ParticipationRecord() { + super(Participation.PARTICIPATION); + } + + /** + * Create a detached, initialised ParticipationRecord + */ + public ParticipationRecord( + UUID id, + UUID eventContext, + UUID performer, + DvCodedTextRecord function, + DvCodedTextRecord mode, + Timestamp timeLower, + String timeLowerTz, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + Timestamp timeUpper, + String timeUpperTz, + Short sysTenant) { + super(Participation.PARTICIPATION); + + setId(id); + setEventContext(eventContext); + setPerformer(performer); + setFunction(function); + setMode(mode); + setTimeLower(timeLower); + setTimeLowerTz(timeLowerTz); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setTimeUpper(timeUpper); + setTimeUpperTz(timeUpperTz); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyIdentifiedRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyIdentifiedRecord.java new file mode 100644 index 0000000..c890d68 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyIdentifiedRecord.java @@ -0,0 +1,480 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyRefIdType; +import org.ehrbase.migration.exporter.v0.jooq.pg.enums.PartyType; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyIdentified; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Record10; +import org.jooq.Record2; +import org.jooq.Row10; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PartyIdentifiedRecord extends UpdatableRecordImpl + implements Record10< + UUID, String, String, String, String, String, PartyType, DvCodedTextRecord, PartyRefIdType, Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.party_identified.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.party_identified.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.party_identified.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for ehr.party_identified.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for ehr.party_identified.party_ref_value. + */ + public void setPartyRefValue(String value) { + set(2, value); + } + + /** + * Getter for ehr.party_identified.party_ref_value. + */ + public String getPartyRefValue() { + return (String) get(2); + } + + /** + * Setter for ehr.party_identified.party_ref_scheme. + */ + public void setPartyRefScheme(String value) { + set(3, value); + } + + /** + * Getter for ehr.party_identified.party_ref_scheme. + */ + public String getPartyRefScheme() { + return (String) get(3); + } + + /** + * Setter for ehr.party_identified.party_ref_namespace. + */ + public void setPartyRefNamespace(String value) { + set(4, value); + } + + /** + * Getter for ehr.party_identified.party_ref_namespace. + */ + public String getPartyRefNamespace() { + return (String) get(4); + } + + /** + * Setter for ehr.party_identified.party_ref_type. + */ + public void setPartyRefType(String value) { + set(5, value); + } + + /** + * Getter for ehr.party_identified.party_ref_type. + */ + public String getPartyRefType() { + return (String) get(5); + } + + /** + * Setter for ehr.party_identified.party_type. + */ + public void setPartyType(PartyType value) { + set(6, value); + } + + /** + * Getter for ehr.party_identified.party_type. + */ + public PartyType getPartyType() { + return (PartyType) get(6); + } + + /** + * Setter for ehr.party_identified.relationship. + */ + public void setRelationship(DvCodedTextRecord value) { + set(7, value); + } + + /** + * Getter for ehr.party_identified.relationship. + */ + public DvCodedTextRecord getRelationship() { + return (DvCodedTextRecord) get(7); + } + + /** + * Setter for ehr.party_identified.object_id_type. + */ + public void setObjectIdType(PartyRefIdType value) { + set(8, value); + } + + /** + * Getter for ehr.party_identified.object_id_type. + */ + public PartyRefIdType getObjectIdType() { + return (PartyRefIdType) get(8); + } + + /** + * Setter for ehr.party_identified.sys_tenant. + */ + public void setSysTenant(Short value) { + set(9, value); + } + + /** + * Getter for ehr.party_identified.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row10 + fieldsRow() { + return (Row10) super.fieldsRow(); + } + + @Override + public Row10 + valuesRow() { + return (Row10) super.valuesRow(); + } + + @Override + public Field field1() { + return PartyIdentified.PARTY_IDENTIFIED.ID; + } + + @Override + public Field field2() { + return PartyIdentified.PARTY_IDENTIFIED.NAME; + } + + @Override + public Field field3() { + return PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_VALUE; + } + + @Override + public Field field4() { + return PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_SCHEME; + } + + @Override + public Field field5() { + return PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_NAMESPACE; + } + + @Override + public Field field6() { + return PartyIdentified.PARTY_IDENTIFIED.PARTY_REF_TYPE; + } + + @Override + public Field field7() { + return PartyIdentified.PARTY_IDENTIFIED.PARTY_TYPE; + } + + @Override + public Field field8() { + return PartyIdentified.PARTY_IDENTIFIED.RELATIONSHIP; + } + + @Override + public Field field9() { + return PartyIdentified.PARTY_IDENTIFIED.OBJECT_ID_TYPE; + } + + @Override + public Field field10() { + return PartyIdentified.PARTY_IDENTIFIED.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getPartyRefValue(); + } + + @Override + public String component4() { + return getPartyRefScheme(); + } + + @Override + public String component5() { + return getPartyRefNamespace(); + } + + @Override + public String component6() { + return getPartyRefType(); + } + + @Override + public PartyType component7() { + return getPartyType(); + } + + @Override + public DvCodedTextRecord component8() { + return getRelationship(); + } + + @Override + public PartyRefIdType component9() { + return getObjectIdType(); + } + + @Override + public Short component10() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getPartyRefValue(); + } + + @Override + public String value4() { + return getPartyRefScheme(); + } + + @Override + public String value5() { + return getPartyRefNamespace(); + } + + @Override + public String value6() { + return getPartyRefType(); + } + + @Override + public PartyType value7() { + return getPartyType(); + } + + @Override + public DvCodedTextRecord value8() { + return getRelationship(); + } + + @Override + public PartyRefIdType value9() { + return getObjectIdType(); + } + + @Override + public Short value10() { + return getSysTenant(); + } + + @Override + public PartyIdentifiedRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public PartyIdentifiedRecord value2(String value) { + setName(value); + return this; + } + + @Override + public PartyIdentifiedRecord value3(String value) { + setPartyRefValue(value); + return this; + } + + @Override + public PartyIdentifiedRecord value4(String value) { + setPartyRefScheme(value); + return this; + } + + @Override + public PartyIdentifiedRecord value5(String value) { + setPartyRefNamespace(value); + return this; + } + + @Override + public PartyIdentifiedRecord value6(String value) { + setPartyRefType(value); + return this; + } + + @Override + public PartyIdentifiedRecord value7(PartyType value) { + setPartyType(value); + return this; + } + + @Override + public PartyIdentifiedRecord value8(DvCodedTextRecord value) { + setRelationship(value); + return this; + } + + @Override + public PartyIdentifiedRecord value9(PartyRefIdType value) { + setObjectIdType(value); + return this; + } + + @Override + public PartyIdentifiedRecord value10(Short value) { + setSysTenant(value); + return this; + } + + @Override + public PartyIdentifiedRecord values( + UUID value1, + String value2, + String value3, + String value4, + String value5, + String value6, + PartyType value7, + DvCodedTextRecord value8, + PartyRefIdType value9, + Short value10) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PartyIdentifiedRecord + */ + public PartyIdentifiedRecord() { + super(PartyIdentified.PARTY_IDENTIFIED); + } + + /** + * Create a detached, initialised PartyIdentifiedRecord + */ + public PartyIdentifiedRecord( + UUID id, + String name, + String partyRefValue, + String partyRefScheme, + String partyRefNamespace, + String partyRefType, + PartyType partyType, + DvCodedTextRecord relationship, + PartyRefIdType objectIdType, + Short sysTenant) { + super(PartyIdentified.PARTY_IDENTIFIED); + + setId(id); + setName(name); + setPartyRefValue(partyRefValue); + setPartyRefScheme(partyRefScheme); + setPartyRefNamespace(partyRefNamespace); + setPartyRefType(partyRefType); + setPartyType(partyType); + setRelationship(relationship); + setObjectIdType(objectIdType); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyUsageIdentificationRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyUsageIdentificationRecord.java new file mode 100644 index 0000000..3350627 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PartyUsageIdentificationRecord.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.PartyUsageIdentification; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PartyUsageIdentificationRecord extends TableRecordImpl + implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.party_usage_identification.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.party_usage_identification.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.party_usage_identification.entity. + */ + public void setEntity(String value) { + set(1, value); + } + + /** + * Getter for ehr.party_usage_identification.entity. + */ + public String getEntity() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION.ID; + } + + @Override + public Field field2() { + return PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION.ENTITY; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getEntity(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getEntity(); + } + + @Override + public PartyUsageIdentificationRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public PartyUsageIdentificationRecord value2(String value) { + setEntity(value); + return this; + } + + @Override + public PartyUsageIdentificationRecord values(UUID value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PartyUsageIdentificationRecord + */ + public PartyUsageIdentificationRecord() { + super(PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION); + } + + /** + * Create a detached, initialised PartyUsageIdentificationRecord + */ + public PartyUsageIdentificationRecord(UUID id, String entity) { + super(PartyUsageIdentification.PARTY_USAGE_IDENTIFICATION); + + setId(id); + setEntity(entity); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PluginRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PluginRecord.java new file mode 100644 index 0000000..99f434b --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/PluginRecord.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Plugin; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * key value store for plugin sub system + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class PluginRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.plugin.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.plugin.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.plugin.pluginid. + */ + public void setPluginid(String value) { + set(1, value); + } + + /** + * Getter for ehr.plugin.pluginid. + */ + public String getPluginid() { + return (String) get(1); + } + + /** + * Setter for ehr.plugin.key. + */ + public void setKey(String value) { + set(2, value); + } + + /** + * Getter for ehr.plugin.key. + */ + public String getKey() { + return (String) get(2); + } + + /** + * Setter for ehr.plugin.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for ehr.plugin.value. + */ + public String getValue() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Plugin.PLUGIN.ID; + } + + @Override + public Field field2() { + return Plugin.PLUGIN.PLUGINID; + } + + @Override + public Field field3() { + return Plugin.PLUGIN.KEY; + } + + @Override + public Field field4() { + return Plugin.PLUGIN.VALUE; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getPluginid(); + } + + @Override + public String component3() { + return getKey(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getPluginid(); + } + + @Override + public String value3() { + return getKey(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public PluginRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public PluginRecord value2(String value) { + setPluginid(value); + return this; + } + + @Override + public PluginRecord value3(String value) { + setKey(value); + return this; + } + + @Override + public PluginRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public PluginRecord values(UUID value1, String value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PluginRecord + */ + public PluginRecord() { + super(Plugin.PLUGIN); + } + + /** + * Create a detached, initialised PluginRecord + */ + public PluginRecord(UUID id, String pluginid, String key, String value) { + super(Plugin.PLUGIN); + + setId(id); + setPluginid(pluginid); + setKey(key); + setValue(value); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SessionLogRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SessionLogRecord.java new file mode 100644 index 0000000..6ececbf --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SessionLogRecord.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.SessionLog; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record8; +import org.jooq.Row8; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class SessionLogRecord extends UpdatableRecordImpl + implements Record8 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.session_log.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.session_log.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.session_log.subject_id. + */ + public void setSubjectId(String value) { + set(1, value); + } + + /** + * Getter for ehr.session_log.subject_id. + */ + public String getSubjectId() { + return (String) get(1); + } + + /** + * Setter for ehr.session_log.node_id. + */ + public void setNodeId(String value) { + set(2, value); + } + + /** + * Getter for ehr.session_log.node_id. + */ + public String getNodeId() { + return (String) get(2); + } + + /** + * Setter for ehr.session_log.session_id. + */ + public void setSessionId(String value) { + set(3, value); + } + + /** + * Getter for ehr.session_log.session_id. + */ + public String getSessionId() { + return (String) get(3); + } + + /** + * Setter for ehr.session_log.session_name. + */ + public void setSessionName(String value) { + set(4, value); + } + + /** + * Getter for ehr.session_log.session_name. + */ + public String getSessionName() { + return (String) get(4); + } + + /** + * Setter for ehr.session_log.session_time. + */ + public void setSessionTime(Timestamp value) { + set(5, value); + } + + /** + * Getter for ehr.session_log.session_time. + */ + public Timestamp getSessionTime() { + return (Timestamp) get(5); + } + + /** + * Setter for ehr.session_log.ip_address. + */ + public void setIpAddress(String value) { + set(6, value); + } + + /** + * Getter for ehr.session_log.ip_address. + */ + public String getIpAddress() { + return (String) get(6); + } + + /** + * Setter for ehr.session_log.sys_tenant. + */ + public void setSysTenant(Short value) { + set(7, value); + } + + /** + * Getter for ehr.session_log.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return SessionLog.SESSION_LOG.ID; + } + + @Override + public Field field2() { + return SessionLog.SESSION_LOG.SUBJECT_ID; + } + + @Override + public Field field3() { + return SessionLog.SESSION_LOG.NODE_ID; + } + + @Override + public Field field4() { + return SessionLog.SESSION_LOG.SESSION_ID; + } + + @Override + public Field field5() { + return SessionLog.SESSION_LOG.SESSION_NAME; + } + + @Override + public Field field6() { + return SessionLog.SESSION_LOG.SESSION_TIME; + } + + @Override + public Field field7() { + return SessionLog.SESSION_LOG.IP_ADDRESS; + } + + @Override + public Field field8() { + return SessionLog.SESSION_LOG.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getSubjectId(); + } + + @Override + public String component3() { + return getNodeId(); + } + + @Override + public String component4() { + return getSessionId(); + } + + @Override + public String component5() { + return getSessionName(); + } + + @Override + public Timestamp component6() { + return getSessionTime(); + } + + @Override + public String component7() { + return getIpAddress(); + } + + @Override + public Short component8() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getSubjectId(); + } + + @Override + public String value3() { + return getNodeId(); + } + + @Override + public String value4() { + return getSessionId(); + } + + @Override + public String value5() { + return getSessionName(); + } + + @Override + public Timestamp value6() { + return getSessionTime(); + } + + @Override + public String value7() { + return getIpAddress(); + } + + @Override + public Short value8() { + return getSysTenant(); + } + + @Override + public SessionLogRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public SessionLogRecord value2(String value) { + setSubjectId(value); + return this; + } + + @Override + public SessionLogRecord value3(String value) { + setNodeId(value); + return this; + } + + @Override + public SessionLogRecord value4(String value) { + setSessionId(value); + return this; + } + + @Override + public SessionLogRecord value5(String value) { + setSessionName(value); + return this; + } + + @Override + public SessionLogRecord value6(Timestamp value) { + setSessionTime(value); + return this; + } + + @Override + public SessionLogRecord value7(String value) { + setIpAddress(value); + return this; + } + + @Override + public SessionLogRecord value8(Short value) { + setSysTenant(value); + return this; + } + + @Override + public SessionLogRecord values( + UUID value1, + String value2, + String value3, + String value4, + String value5, + Timestamp value6, + String value7, + Short value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached SessionLogRecord + */ + public SessionLogRecord() { + super(SessionLog.SESSION_LOG); + } + + /** + * Create a detached, initialised SessionLogRecord + */ + public SessionLogRecord( + UUID id, + String subjectId, + String nodeId, + String sessionId, + String sessionName, + Timestamp sessionTime, + String ipAddress, + Short sysTenant) { + super(SessionLog.SESSION_LOG); + + setId(id); + setSubjectId(subjectId); + setNodeId(nodeId); + setSessionId(sessionId); + setSessionName(sessionName); + setSessionTime(sessionTime); + setIpAddress(ipAddress); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusHistoryRecord.java new file mode 100644 index 0000000..bed5dff --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusHistoryRecord.java @@ -0,0 +1,668 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import com.nedap.archie.rm.datastructures.ItemStructure; +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StatusHistory; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Record14; +import org.jooq.Row14; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class StatusHistoryRecord extends TableRecordImpl + implements Record14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.status_history.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.status_history.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.status_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.status_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.status_history.is_queryable. + */ + public void setIsQueryable(Boolean value) { + set(2, value); + } + + /** + * Getter for ehr.status_history.is_queryable. + */ + public Boolean getIsQueryable() { + return (Boolean) get(2); + } + + /** + * Setter for ehr.status_history.is_modifiable. + */ + public void setIsModifiable(Boolean value) { + set(3, value); + } + + /** + * Getter for ehr.status_history.is_modifiable. + */ + public Boolean getIsModifiable() { + return (Boolean) get(3); + } + + /** + * Setter for ehr.status_history.party. + */ + public void setParty(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.status_history.party. + */ + public UUID getParty() { + return (UUID) get(4); + } + + /** + * Setter for ehr.status_history.other_details. + */ + public void setOtherDetails(ItemStructure value) { + set(5, value); + } + + /** + * Getter for ehr.status_history.other_details. + */ + public ItemStructure getOtherDetails() { + return (ItemStructure) get(5); + } + + /** + * Setter for ehr.status_history.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(6, value); + } + + /** + * Getter for ehr.status_history.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(6); + } + + /** + * Setter for ehr.status_history.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(7, value); + } + + /** + * Getter for ehr.status_history.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(7); + } + + /** + * Setter for ehr.status_history.has_audit. + */ + public void setHasAudit(UUID value) { + set(8, value); + } + + /** + * Getter for ehr.status_history.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(8); + } + + /** + * Setter for ehr.status_history.attestation_ref. + */ + public void setAttestationRef(UUID value) { + set(9, value); + } + + /** + * Getter for ehr.status_history.attestation_ref. + */ + public UUID getAttestationRef() { + return (UUID) get(9); + } + + /** + * Setter for ehr.status_history.in_contribution. + */ + public void setInContribution(UUID value) { + set(10, value); + } + + /** + * Getter for ehr.status_history.in_contribution. + */ + public UUID getInContribution() { + return (UUID) get(10); + } + + /** + * Setter for ehr.status_history.archetype_node_id. + */ + public void setArchetypeNodeId(String value) { + set(11, value); + } + + /** + * Getter for ehr.status_history.archetype_node_id. + */ + public String getArchetypeNodeId() { + return (String) get(11); + } + + /** + * Setter for ehr.status_history.name. + */ + public void setName(DvCodedTextRecord value) { + set(12, value); + } + + /** + * Getter for ehr.status_history.name. + */ + public DvCodedTextRecord getName() { + return (DvCodedTextRecord) get(12); + } + + /** + * Setter for ehr.status_history.sys_tenant. + */ + public void setSysTenant(Short value) { + set(13, value); + } + + /** + * Getter for ehr.status_history.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(13); + } + + // ------------------------------------------------------------------------- + // Record14 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + @Override + public Row14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> + valuesRow() { + return (Row14) super.valuesRow(); + } + + @Override + public Field field1() { + return StatusHistory.STATUS_HISTORY.ID; + } + + @Override + public Field field2() { + return StatusHistory.STATUS_HISTORY.EHR_ID; + } + + @Override + public Field field3() { + return StatusHistory.STATUS_HISTORY.IS_QUERYABLE; + } + + @Override + public Field field4() { + return StatusHistory.STATUS_HISTORY.IS_MODIFIABLE; + } + + @Override + public Field field5() { + return StatusHistory.STATUS_HISTORY.PARTY; + } + + @Override + public Field field6() { + return StatusHistory.STATUS_HISTORY.OTHER_DETAILS; + } + + @Override + public Field field7() { + return StatusHistory.STATUS_HISTORY.SYS_TRANSACTION; + } + + @Override + public Field> field8() { + return StatusHistory.STATUS_HISTORY.SYS_PERIOD; + } + + @Override + public Field field9() { + return StatusHistory.STATUS_HISTORY.HAS_AUDIT; + } + + @Override + public Field field10() { + return StatusHistory.STATUS_HISTORY.ATTESTATION_REF; + } + + @Override + public Field field11() { + return StatusHistory.STATUS_HISTORY.IN_CONTRIBUTION; + } + + @Override + public Field field12() { + return StatusHistory.STATUS_HISTORY.ARCHETYPE_NODE_ID; + } + + @Override + public Field field13() { + return StatusHistory.STATUS_HISTORY.NAME; + } + + @Override + public Field field14() { + return StatusHistory.STATUS_HISTORY.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public Boolean component3() { + return getIsQueryable(); + } + + @Override + public Boolean component4() { + return getIsModifiable(); + } + + @Override + public UUID component5() { + return getParty(); + } + + @Override + public ItemStructure component6() { + return getOtherDetails(); + } + + @Override + public Timestamp component7() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component8() { + return getSysPeriod(); + } + + @Override + public UUID component9() { + return getHasAudit(); + } + + @Override + public UUID component10() { + return getAttestationRef(); + } + + @Override + public UUID component11() { + return getInContribution(); + } + + @Override + public String component12() { + return getArchetypeNodeId(); + } + + @Override + public DvCodedTextRecord component13() { + return getName(); + } + + @Override + public Short component14() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public Boolean value3() { + return getIsQueryable(); + } + + @Override + public Boolean value4() { + return getIsModifiable(); + } + + @Override + public UUID value5() { + return getParty(); + } + + @Override + public ItemStructure value6() { + return getOtherDetails(); + } + + @Override + public Timestamp value7() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value8() { + return getSysPeriod(); + } + + @Override + public UUID value9() { + return getHasAudit(); + } + + @Override + public UUID value10() { + return getAttestationRef(); + } + + @Override + public UUID value11() { + return getInContribution(); + } + + @Override + public String value12() { + return getArchetypeNodeId(); + } + + @Override + public DvCodedTextRecord value13() { + return getName(); + } + + @Override + public Short value14() { + return getSysTenant(); + } + + @Override + public StatusHistoryRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public StatusHistoryRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public StatusHistoryRecord value3(Boolean value) { + setIsQueryable(value); + return this; + } + + @Override + public StatusHistoryRecord value4(Boolean value) { + setIsModifiable(value); + return this; + } + + @Override + public StatusHistoryRecord value5(UUID value) { + setParty(value); + return this; + } + + @Override + public StatusHistoryRecord value6(ItemStructure value) { + setOtherDetails(value); + return this; + } + + @Override + public StatusHistoryRecord value7(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public StatusHistoryRecord value8(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public StatusHistoryRecord value9(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public StatusHistoryRecord value10(UUID value) { + setAttestationRef(value); + return this; + } + + @Override + public StatusHistoryRecord value11(UUID value) { + setInContribution(value); + return this; + } + + @Override + public StatusHistoryRecord value12(String value) { + setArchetypeNodeId(value); + return this; + } + + @Override + public StatusHistoryRecord value13(DvCodedTextRecord value) { + setName(value); + return this; + } + + @Override + public StatusHistoryRecord value14(Short value) { + setSysTenant(value); + return this; + } + + @Override + public StatusHistoryRecord values( + UUID value1, + UUID value2, + Boolean value3, + Boolean value4, + UUID value5, + ItemStructure value6, + Timestamp value7, + SimpleEntry value8, + UUID value9, + UUID value10, + UUID value11, + String value12, + DvCodedTextRecord value13, + Short value14) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached StatusHistoryRecord + */ + public StatusHistoryRecord() { + super(StatusHistory.STATUS_HISTORY); + } + + /** + * Create a detached, initialised StatusHistoryRecord + */ + public StatusHistoryRecord( + UUID id, + UUID ehrId, + Boolean isQueryable, + Boolean isModifiable, + UUID party, + ItemStructure otherDetails, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + UUID hasAudit, + UUID attestationRef, + UUID inContribution, + String archetypeNodeId, + DvCodedTextRecord name, + Short sysTenant) { + super(StatusHistory.STATUS_HISTORY); + + setId(id); + setEhrId(ehrId); + setIsQueryable(isQueryable); + setIsModifiable(isModifiable); + setParty(party); + setOtherDetails(otherDetails); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setHasAudit(hasAudit); + setAttestationRef(attestationRef); + setInContribution(inContribution); + setArchetypeNodeId(archetypeNodeId); + setName(name); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusRecord.java new file mode 100644 index 0000000..09c87a1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StatusRecord.java @@ -0,0 +1,678 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import com.nedap.archie.rm.datastructures.ItemStructure; +import java.sql.Timestamp; +import java.util.AbstractMap.SimpleEntry; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Status; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Field; +import org.jooq.Record14; +import org.jooq.Record2; +import org.jooq.Row14; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * specifies an ehr modality and ownership (patient) + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class StatusRecord extends UpdatableRecordImpl + implements Record14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.status.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.status.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.status.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.status.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.status.is_queryable. + */ + public void setIsQueryable(Boolean value) { + set(2, value); + } + + /** + * Getter for ehr.status.is_queryable. + */ + public Boolean getIsQueryable() { + return (Boolean) get(2); + } + + /** + * Setter for ehr.status.is_modifiable. + */ + public void setIsModifiable(Boolean value) { + set(3, value); + } + + /** + * Getter for ehr.status.is_modifiable. + */ + public Boolean getIsModifiable() { + return (Boolean) get(3); + } + + /** + * Setter for ehr.status.party. + */ + public void setParty(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.status.party. + */ + public UUID getParty() { + return (UUID) get(4); + } + + /** + * Setter for ehr.status.other_details. + */ + public void setOtherDetails(ItemStructure value) { + set(5, value); + } + + /** + * Getter for ehr.status.other_details. + */ + public ItemStructure getOtherDetails() { + return (ItemStructure) get(5); + } + + /** + * Setter for ehr.status.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(6, value); + } + + /** + * Getter for ehr.status.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(6); + } + + /** + * Setter for ehr.status.sys_period. + */ + public void setSysPeriod(SimpleEntry value) { + set(7, value); + } + + /** + * Getter for ehr.status.sys_period. + */ + public SimpleEntry getSysPeriod() { + return (SimpleEntry) get(7); + } + + /** + * Setter for ehr.status.has_audit. + */ + public void setHasAudit(UUID value) { + set(8, value); + } + + /** + * Getter for ehr.status.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(8); + } + + /** + * Setter for ehr.status.attestation_ref. + */ + public void setAttestationRef(UUID value) { + set(9, value); + } + + /** + * Getter for ehr.status.attestation_ref. + */ + public UUID getAttestationRef() { + return (UUID) get(9); + } + + /** + * Setter for ehr.status.in_contribution. + */ + public void setInContribution(UUID value) { + set(10, value); + } + + /** + * Getter for ehr.status.in_contribution. + */ + public UUID getInContribution() { + return (UUID) get(10); + } + + /** + * Setter for ehr.status.archetype_node_id. + */ + public void setArchetypeNodeId(String value) { + set(11, value); + } + + /** + * Getter for ehr.status.archetype_node_id. + */ + public String getArchetypeNodeId() { + return (String) get(11); + } + + /** + * Setter for ehr.status.name. + */ + public void setName(DvCodedTextRecord value) { + set(12, value); + } + + /** + * Getter for ehr.status.name. + */ + public DvCodedTextRecord getName() { + return (DvCodedTextRecord) get(12); + } + + /** + * Setter for ehr.status.sys_tenant. + */ + public void setSysTenant(Short value) { + set(13, value); + } + + /** + * Getter for ehr.status.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(13); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record14 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + @Override + public Row14< + UUID, + UUID, + Boolean, + Boolean, + UUID, + ItemStructure, + Timestamp, + SimpleEntry, + UUID, + UUID, + UUID, + String, + DvCodedTextRecord, + Short> + valuesRow() { + return (Row14) super.valuesRow(); + } + + @Override + public Field field1() { + return Status.STATUS.ID; + } + + @Override + public Field field2() { + return Status.STATUS.EHR_ID; + } + + @Override + public Field field3() { + return Status.STATUS.IS_QUERYABLE; + } + + @Override + public Field field4() { + return Status.STATUS.IS_MODIFIABLE; + } + + @Override + public Field field5() { + return Status.STATUS.PARTY; + } + + @Override + public Field field6() { + return Status.STATUS.OTHER_DETAILS; + } + + @Override + public Field field7() { + return Status.STATUS.SYS_TRANSACTION; + } + + @Override + public Field> field8() { + return Status.STATUS.SYS_PERIOD; + } + + @Override + public Field field9() { + return Status.STATUS.HAS_AUDIT; + } + + @Override + public Field field10() { + return Status.STATUS.ATTESTATION_REF; + } + + @Override + public Field field11() { + return Status.STATUS.IN_CONTRIBUTION; + } + + @Override + public Field field12() { + return Status.STATUS.ARCHETYPE_NODE_ID; + } + + @Override + public Field field13() { + return Status.STATUS.NAME; + } + + @Override + public Field field14() { + return Status.STATUS.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public Boolean component3() { + return getIsQueryable(); + } + + @Override + public Boolean component4() { + return getIsModifiable(); + } + + @Override + public UUID component5() { + return getParty(); + } + + @Override + public ItemStructure component6() { + return getOtherDetails(); + } + + @Override + public Timestamp component7() { + return getSysTransaction(); + } + + @Override + public SimpleEntry component8() { + return getSysPeriod(); + } + + @Override + public UUID component9() { + return getHasAudit(); + } + + @Override + public UUID component10() { + return getAttestationRef(); + } + + @Override + public UUID component11() { + return getInContribution(); + } + + @Override + public String component12() { + return getArchetypeNodeId(); + } + + @Override + public DvCodedTextRecord component13() { + return getName(); + } + + @Override + public Short component14() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public Boolean value3() { + return getIsQueryable(); + } + + @Override + public Boolean value4() { + return getIsModifiable(); + } + + @Override + public UUID value5() { + return getParty(); + } + + @Override + public ItemStructure value6() { + return getOtherDetails(); + } + + @Override + public Timestamp value7() { + return getSysTransaction(); + } + + @Override + public SimpleEntry value8() { + return getSysPeriod(); + } + + @Override + public UUID value9() { + return getHasAudit(); + } + + @Override + public UUID value10() { + return getAttestationRef(); + } + + @Override + public UUID value11() { + return getInContribution(); + } + + @Override + public String value12() { + return getArchetypeNodeId(); + } + + @Override + public DvCodedTextRecord value13() { + return getName(); + } + + @Override + public Short value14() { + return getSysTenant(); + } + + @Override + public StatusRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public StatusRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public StatusRecord value3(Boolean value) { + setIsQueryable(value); + return this; + } + + @Override + public StatusRecord value4(Boolean value) { + setIsModifiable(value); + return this; + } + + @Override + public StatusRecord value5(UUID value) { + setParty(value); + return this; + } + + @Override + public StatusRecord value6(ItemStructure value) { + setOtherDetails(value); + return this; + } + + @Override + public StatusRecord value7(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public StatusRecord value8(SimpleEntry value) { + setSysPeriod(value); + return this; + } + + @Override + public StatusRecord value9(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public StatusRecord value10(UUID value) { + setAttestationRef(value); + return this; + } + + @Override + public StatusRecord value11(UUID value) { + setInContribution(value); + return this; + } + + @Override + public StatusRecord value12(String value) { + setArchetypeNodeId(value); + return this; + } + + @Override + public StatusRecord value13(DvCodedTextRecord value) { + setName(value); + return this; + } + + @Override + public StatusRecord value14(Short value) { + setSysTenant(value); + return this; + } + + @Override + public StatusRecord values( + UUID value1, + UUID value2, + Boolean value3, + Boolean value4, + UUID value5, + ItemStructure value6, + Timestamp value7, + SimpleEntry value8, + UUID value9, + UUID value10, + UUID value11, + String value12, + DvCodedTextRecord value13, + Short value14) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached StatusRecord + */ + public StatusRecord() { + super(Status.STATUS); + } + + /** + * Create a detached, initialised StatusRecord + */ + public StatusRecord( + UUID id, + UUID ehrId, + Boolean isQueryable, + Boolean isModifiable, + UUID party, + ItemStructure otherDetails, + Timestamp sysTransaction, + SimpleEntry sysPeriod, + UUID hasAudit, + UUID attestationRef, + UUID inContribution, + String archetypeNodeId, + DvCodedTextRecord name, + Short sysTenant) { + super(Status.STATUS); + + setId(id); + setEhrId(ehrId); + setIsQueryable(isQueryable); + setIsModifiable(isModifiable); + setParty(party); + setOtherDetails(otherDetails); + setSysTransaction(sysTransaction); + setSysPeriod(sysPeriod); + setHasAudit(hasAudit); + setAttestationRef(attestationRef); + setInContribution(inContribution); + setArchetypeNodeId(archetypeNodeId); + setName(name); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StoredQueryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StoredQueryRecord.java new file mode 100644 index 0000000..2ef7c91 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/StoredQueryRecord.java @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.StoredQuery; +import org.jooq.Field; +import org.jooq.Record4; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class StoredQueryRecord extends UpdatableRecordImpl + implements Record7 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.stored_query.reverse_domain_name. + */ + public void setReverseDomainName(String value) { + set(0, value); + } + + /** + * Getter for ehr.stored_query.reverse_domain_name. + */ + public String getReverseDomainName() { + return (String) get(0); + } + + /** + * Setter for ehr.stored_query.semantic_id. + */ + public void setSemanticId(String value) { + set(1, value); + } + + /** + * Getter for ehr.stored_query.semantic_id. + */ + public String getSemanticId() { + return (String) get(1); + } + + /** + * Setter for ehr.stored_query.semver. + */ + public void setSemver(String value) { + set(2, value); + } + + /** + * Getter for ehr.stored_query.semver. + */ + public String getSemver() { + return (String) get(2); + } + + /** + * Setter for ehr.stored_query.query_text. + */ + public void setQueryText(String value) { + set(3, value); + } + + /** + * Getter for ehr.stored_query.query_text. + */ + public String getQueryText() { + return (String) get(3); + } + + /** + * Setter for ehr.stored_query.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(4, value); + } + + /** + * Getter for ehr.stored_query.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(4); + } + + /** + * Setter for ehr.stored_query.type. + */ + public void setType(String value) { + set(5, value); + } + + /** + * Getter for ehr.stored_query.type. + */ + public String getType() { + return (String) get(5); + } + + /** + * Setter for ehr.stored_query.sys_tenant. + */ + public void setSysTenant(Short value) { + set(6, value); + } + + /** + * Getter for ehr.stored_query.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record4 key() { + return (Record4) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return StoredQuery.STORED_QUERY.REVERSE_DOMAIN_NAME; + } + + @Override + public Field field2() { + return StoredQuery.STORED_QUERY.SEMANTIC_ID; + } + + @Override + public Field field3() { + return StoredQuery.STORED_QUERY.SEMVER; + } + + @Override + public Field field4() { + return StoredQuery.STORED_QUERY.QUERY_TEXT; + } + + @Override + public Field field5() { + return StoredQuery.STORED_QUERY.CREATION_DATE; + } + + @Override + public Field field6() { + return StoredQuery.STORED_QUERY.TYPE; + } + + @Override + public Field field7() { + return StoredQuery.STORED_QUERY.SYS_TENANT; + } + + @Override + public String component1() { + return getReverseDomainName(); + } + + @Override + public String component2() { + return getSemanticId(); + } + + @Override + public String component3() { + return getSemver(); + } + + @Override + public String component4() { + return getQueryText(); + } + + @Override + public Timestamp component5() { + return getCreationDate(); + } + + @Override + public String component6() { + return getType(); + } + + @Override + public Short component7() { + return getSysTenant(); + } + + @Override + public String value1() { + return getReverseDomainName(); + } + + @Override + public String value2() { + return getSemanticId(); + } + + @Override + public String value3() { + return getSemver(); + } + + @Override + public String value4() { + return getQueryText(); + } + + @Override + public Timestamp value5() { + return getCreationDate(); + } + + @Override + public String value6() { + return getType(); + } + + @Override + public Short value7() { + return getSysTenant(); + } + + @Override + public StoredQueryRecord value1(String value) { + setReverseDomainName(value); + return this; + } + + @Override + public StoredQueryRecord value2(String value) { + setSemanticId(value); + return this; + } + + @Override + public StoredQueryRecord value3(String value) { + setSemver(value); + return this; + } + + @Override + public StoredQueryRecord value4(String value) { + setQueryText(value); + return this; + } + + @Override + public StoredQueryRecord value5(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public StoredQueryRecord value6(String value) { + setType(value); + return this; + } + + @Override + public StoredQueryRecord value7(Short value) { + setSysTenant(value); + return this; + } + + @Override + public StoredQueryRecord values( + String value1, String value2, String value3, String value4, Timestamp value5, String value6, Short value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached StoredQueryRecord + */ + public StoredQueryRecord() { + super(StoredQuery.STORED_QUERY); + } + + /** + * Create a detached, initialised StoredQueryRecord + */ + public StoredQueryRecord( + String reverseDomainName, + String semanticId, + String semver, + String queryText, + Timestamp creationDate, + String type, + Short sysTenant) { + super(StoredQuery.STORED_QUERY); + + setReverseDomainName(reverseDomainName); + setSemanticId(semanticId); + setSemver(semver); + setQueryText(queryText); + setCreationDate(creationDate); + setType(type); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SystemRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SystemRecord.java new file mode 100644 index 0000000..bb783af --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/SystemRecord.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.System; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * system table for reference + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class SystemRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.system.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.system.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.system.description. + */ + public void setDescription(String value) { + set(1, value); + } + + /** + * Getter for ehr.system.description. + */ + public String getDescription() { + return (String) get(1); + } + + /** + * Setter for ehr.system.settings. + */ + public void setSettings(String value) { + set(2, value); + } + + /** + * Getter for ehr.system.settings. + */ + public String getSettings() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return System.SYSTEM.ID; + } + + @Override + public Field field2() { + return System.SYSTEM.DESCRIPTION; + } + + @Override + public Field field3() { + return System.SYSTEM.SETTINGS; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getDescription(); + } + + @Override + public String component3() { + return getSettings(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getDescription(); + } + + @Override + public String value3() { + return getSettings(); + } + + @Override + public SystemRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public SystemRecord value2(String value) { + setDescription(value); + return this; + } + + @Override + public SystemRecord value3(String value) { + setSettings(value); + return this; + } + + @Override + public SystemRecord values(UUID value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached SystemRecord + */ + public SystemRecord() { + super(System.SYSTEM); + } + + /** + * Create a detached, initialised SystemRecord + */ + public SystemRecord(UUID id, String description, String settings) { + super(System.SYSTEM); + + setId(id); + setDescription(description); + setSettings(settings); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TemplateStoreRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TemplateStoreRecord.java new file mode 100644 index 0000000..13eb93e --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TemplateStoreRecord.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.sql.Timestamp; +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TemplateStore; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TemplateStoreRecord extends UpdatableRecordImpl + implements Record5 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.template_store.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.template_store.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.template_store.template_id. + */ + public void setTemplateId(String value) { + set(1, value); + } + + /** + * Getter for ehr.template_store.template_id. + */ + public String getTemplateId() { + return (String) get(1); + } + + /** + * Setter for ehr.template_store.content. + */ + public void setContent(String value) { + set(2, value); + } + + /** + * Getter for ehr.template_store.content. + */ + public String getContent() { + return (String) get(2); + } + + /** + * Setter for ehr.template_store.sys_transaction. + */ + public void setSysTransaction(Timestamp value) { + set(3, value); + } + + /** + * Getter for ehr.template_store.sys_transaction. + */ + public Timestamp getSysTransaction() { + return (Timestamp) get(3); + } + + /** + * Setter for ehr.template_store.sys_tenant. + */ + public void setSysTenant(Short value) { + set(4, value); + } + + /** + * Getter for ehr.template_store.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return TemplateStore.TEMPLATE_STORE.ID; + } + + @Override + public Field field2() { + return TemplateStore.TEMPLATE_STORE.TEMPLATE_ID; + } + + @Override + public Field field3() { + return TemplateStore.TEMPLATE_STORE.CONTENT; + } + + @Override + public Field field4() { + return TemplateStore.TEMPLATE_STORE.SYS_TRANSACTION; + } + + @Override + public Field field5() { + return TemplateStore.TEMPLATE_STORE.SYS_TENANT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getTemplateId(); + } + + @Override + public String component3() { + return getContent(); + } + + @Override + public Timestamp component4() { + return getSysTransaction(); + } + + @Override + public Short component5() { + return getSysTenant(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getTemplateId(); + } + + @Override + public String value3() { + return getContent(); + } + + @Override + public Timestamp value4() { + return getSysTransaction(); + } + + @Override + public Short value5() { + return getSysTenant(); + } + + @Override + public TemplateStoreRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public TemplateStoreRecord value2(String value) { + setTemplateId(value); + return this; + } + + @Override + public TemplateStoreRecord value3(String value) { + setContent(value); + return this; + } + + @Override + public TemplateStoreRecord value4(Timestamp value) { + setSysTransaction(value); + return this; + } + + @Override + public TemplateStoreRecord value5(Short value) { + setSysTenant(value); + return this; + } + + @Override + public TemplateStoreRecord values(UUID value1, String value2, String value3, Timestamp value4, Short value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TemplateStoreRecord + */ + public TemplateStoreRecord() { + super(TemplateStore.TEMPLATE_STORE); + } + + /** + * Create a detached, initialised TemplateStoreRecord + */ + public TemplateStoreRecord(UUID id, String templateId, String content, Timestamp sysTransaction, Short sysTenant) { + super(TemplateStore.TEMPLATE_STORE); + + setId(id); + setTemplateId(templateId); + setContent(content); + setSysTransaction(sysTransaction); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TenantRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TenantRecord.java new file mode 100644 index 0000000..206f4bf --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TenantRecord.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Tenant; +import org.jooq.Field; +import org.jooq.JSON; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TenantRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.tenant.tenant_id. + */ + public void setTenantId(String value) { + set(0, value); + } + + /** + * Getter for ehr.tenant.tenant_id. + */ + public String getTenantId() { + return (String) get(0); + } + + /** + * Setter for ehr.tenant.tenant_name. + */ + public void setTenantName(String value) { + set(1, value); + } + + /** + * Getter for ehr.tenant.tenant_name. + */ + public String getTenantName() { + return (String) get(1); + } + + /** + * Setter for ehr.tenant.tenant_properties. + */ + public void setTenantProperties(JSON value) { + set(2, value); + } + + /** + * Getter for ehr.tenant.tenant_properties. + */ + public JSON getTenantProperties() { + return (JSON) get(2); + } + + /** + * Setter for ehr.tenant.id. + */ + public void setId(Short value) { + set(3, value); + } + + /** + * Getter for ehr.tenant.id. + */ + public Short getId() { + return (Short) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Tenant.TENANT.TENANT_ID; + } + + @Override + public Field field2() { + return Tenant.TENANT.TENANT_NAME; + } + + @Override + public Field field3() { + return Tenant.TENANT.TENANT_PROPERTIES; + } + + @Override + public Field field4() { + return Tenant.TENANT.ID; + } + + @Override + public String component1() { + return getTenantId(); + } + + @Override + public String component2() { + return getTenantName(); + } + + @Override + public JSON component3() { + return getTenantProperties(); + } + + @Override + public Short component4() { + return getId(); + } + + @Override + public String value1() { + return getTenantId(); + } + + @Override + public String value2() { + return getTenantName(); + } + + @Override + public JSON value3() { + return getTenantProperties(); + } + + @Override + public Short value4() { + return getId(); + } + + @Override + public TenantRecord value1(String value) { + setTenantId(value); + return this; + } + + @Override + public TenantRecord value2(String value) { + setTenantName(value); + return this; + } + + @Override + public TenantRecord value3(JSON value) { + setTenantProperties(value); + return this; + } + + @Override + public TenantRecord value4(Short value) { + setId(value); + return this; + } + + @Override + public TenantRecord values(String value1, String value2, JSON value3, Short value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TenantRecord + */ + public TenantRecord() { + super(Tenant.TENANT); + } + + /** + * Create a detached, initialised TenantRecord + */ + public TenantRecord(String tenantId, String tenantName, JSON tenantProperties, Short id) { + super(Tenant.TENANT); + + setTenantId(tenantId); + setTenantName(tenantName); + setTenantProperties(tenantProperties); + setId(id); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerminologyProviderRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerminologyProviderRecord.java new file mode 100644 index 0000000..e2b82ad --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerminologyProviderRecord.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.TerminologyProvider; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * openEHR identified terminology provider + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TerminologyProviderRecord extends UpdatableRecordImpl + implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.terminology_provider.code. + */ + public void setCode(String value) { + set(0, value); + } + + /** + * Getter for ehr.terminology_provider.code. + */ + public String getCode() { + return (String) get(0); + } + + /** + * Setter for ehr.terminology_provider.source. + */ + public void setSource(String value) { + set(1, value); + } + + /** + * Getter for ehr.terminology_provider.source. + */ + public String getSource() { + return (String) get(1); + } + + /** + * Setter for ehr.terminology_provider.authority. + */ + public void setAuthority(String value) { + set(2, value); + } + + /** + * Getter for ehr.terminology_provider.authority. + */ + public String getAuthority() { + return (String) get(2); + } + + /** + * Setter for ehr.terminology_provider.sys_tenant. + */ + public void setSysTenant(Short value) { + set(3, value); + } + + /** + * Getter for ehr.terminology_provider.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return TerminologyProvider.TERMINOLOGY_PROVIDER.CODE; + } + + @Override + public Field field2() { + return TerminologyProvider.TERMINOLOGY_PROVIDER.SOURCE; + } + + @Override + public Field field3() { + return TerminologyProvider.TERMINOLOGY_PROVIDER.AUTHORITY; + } + + @Override + public Field field4() { + return TerminologyProvider.TERMINOLOGY_PROVIDER.SYS_TENANT; + } + + @Override + public String component1() { + return getCode(); + } + + @Override + public String component2() { + return getSource(); + } + + @Override + public String component3() { + return getAuthority(); + } + + @Override + public Short component4() { + return getSysTenant(); + } + + @Override + public String value1() { + return getCode(); + } + + @Override + public String value2() { + return getSource(); + } + + @Override + public String value3() { + return getAuthority(); + } + + @Override + public Short value4() { + return getSysTenant(); + } + + @Override + public TerminologyProviderRecord value1(String value) { + setCode(value); + return this; + } + + @Override + public TerminologyProviderRecord value2(String value) { + setSource(value); + return this; + } + + @Override + public TerminologyProviderRecord value3(String value) { + setAuthority(value); + return this; + } + + @Override + public TerminologyProviderRecord value4(Short value) { + setSysTenant(value); + return this; + } + + @Override + public TerminologyProviderRecord values(String value1, String value2, String value3, Short value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TerminologyProviderRecord + */ + public TerminologyProviderRecord() { + super(TerminologyProvider.TERMINOLOGY_PROVIDER); + } + + /** + * Create a detached, initialised TerminologyProviderRecord + */ + public TerminologyProviderRecord(String code, String source, String authority, Short sysTenant) { + super(TerminologyProvider.TERMINOLOGY_PROVIDER); + + setCode(code); + setSource(source); + setAuthority(authority); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerritoryRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerritoryRecord.java new file mode 100644 index 0000000..0a6a03c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/TerritoryRecord.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Territory; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * ISO 3166-1 countries codeset + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TerritoryRecord extends UpdatableRecordImpl + implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.territory.code. + */ + public void setCode(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.territory.code. + */ + public Integer getCode() { + return (Integer) get(0); + } + + /** + * Setter for ehr.territory.twoletter. + */ + public void setTwoletter(String value) { + set(1, value); + } + + /** + * Getter for ehr.territory.twoletter. + */ + public String getTwoletter() { + return (String) get(1); + } + + /** + * Setter for ehr.territory.threeletter. + */ + public void setThreeletter(String value) { + set(2, value); + } + + /** + * Getter for ehr.territory.threeletter. + */ + public String getThreeletter() { + return (String) get(2); + } + + /** + * Setter for ehr.territory.text. + */ + public void setText(String value) { + set(3, value); + } + + /** + * Getter for ehr.territory.text. + */ + public String getText() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Territory.TERRITORY.CODE; + } + + @Override + public Field field2() { + return Territory.TERRITORY.TWOLETTER; + } + + @Override + public Field field3() { + return Territory.TERRITORY.THREELETTER; + } + + @Override + public Field field4() { + return Territory.TERRITORY.TEXT; + } + + @Override + public Integer component1() { + return getCode(); + } + + @Override + public String component2() { + return getTwoletter(); + } + + @Override + public String component3() { + return getThreeletter(); + } + + @Override + public String component4() { + return getText(); + } + + @Override + public Integer value1() { + return getCode(); + } + + @Override + public String value2() { + return getTwoletter(); + } + + @Override + public String value3() { + return getThreeletter(); + } + + @Override + public String value4() { + return getText(); + } + + @Override + public TerritoryRecord value1(Integer value) { + setCode(value); + return this; + } + + @Override + public TerritoryRecord value2(String value) { + setTwoletter(value); + return this; + } + + @Override + public TerritoryRecord value3(String value) { + setThreeletter(value); + return this; + } + + @Override + public TerritoryRecord value4(String value) { + setText(value); + return this; + } + + @Override + public TerritoryRecord values(Integer value1, String value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TerritoryRecord + */ + public TerritoryRecord() { + super(Territory.TERRITORY); + } + + /** + * Create a detached, initialised TerritoryRecord + */ + public TerritoryRecord(Integer code, String twoletter, String threeletter, String text) { + super(Territory.TERRITORY); + + setCode(code); + setTwoletter(twoletter); + setThreeletter(threeletter); + setText(text); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/UsersRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/UsersRecord.java new file mode 100644 index 0000000..a4020ea --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/UsersRecord.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.Users; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class UsersRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.users.username. + */ + public void setUsername(String value) { + set(0, value); + } + + /** + * Getter for ehr.users.username. + */ + public String getUsername() { + return (String) get(0); + } + + /** + * Setter for ehr.users.party_id. + */ + public void setPartyId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.users.party_id. + */ + public UUID getPartyId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.users.sys_tenant. + */ + public void setSysTenant(Short value) { + set(2, value); + } + + /** + * Getter for ehr.users.sys_tenant. + */ + public Short getSysTenant() { + return (Short) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return Users.USERS.USERNAME; + } + + @Override + public Field field2() { + return Users.USERS.PARTY_ID; + } + + @Override + public Field field3() { + return Users.USERS.SYS_TENANT; + } + + @Override + public String component1() { + return getUsername(); + } + + @Override + public UUID component2() { + return getPartyId(); + } + + @Override + public Short component3() { + return getSysTenant(); + } + + @Override + public String value1() { + return getUsername(); + } + + @Override + public UUID value2() { + return getPartyId(); + } + + @Override + public Short value3() { + return getSysTenant(); + } + + @Override + public UsersRecord value1(String value) { + setUsername(value); + return this; + } + + @Override + public UsersRecord value2(UUID value) { + setPartyId(value); + return this; + } + + @Override + public UsersRecord value3(Short value) { + setSysTenant(value); + return this; + } + + @Override + public UsersRecord values(String value1, UUID value2, Short value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached UsersRecord + */ + public UsersRecord() { + super(Users.USERS); + } + + /** + * Create a detached, initialised UsersRecord + */ + public UsersRecord(String username, UUID partyId, Short sysTenant) { + super(Users.USERS); + + setUsername(username); + setPartyId(partyId); + setSysTenant(sysTenant); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/XjsonbArrayElementsRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/XjsonbArrayElementsRecord.java new file mode 100644 index 0000000..db8ef60 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/tables/records/XjsonbArrayElementsRecord.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.tables.XjsonbArrayElements; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record1; +import org.jooq.Row1; +import org.jooq.impl.TableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class XjsonbArrayElementsRecord extends TableRecordImpl implements Record1 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.xjsonb_array_elements.xjsonb_array_elements. + */ + public void setXjsonbArrayElements(JSONB value) { + set(0, value); + } + + /** + * Getter for ehr.xjsonb_array_elements.xjsonb_array_elements. + */ + public JSONB getXjsonbArrayElements() { + return (JSONB) get(0); + } + + // ------------------------------------------------------------------------- + // Record1 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row1 fieldsRow() { + return (Row1) super.fieldsRow(); + } + + @Override + public Row1 valuesRow() { + return (Row1) super.valuesRow(); + } + + @Override + public Field field1() { + return XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS.XJSONB_ARRAY_ELEMENTS_; + } + + @Override + public JSONB component1() { + return getXjsonbArrayElements(); + } + + @Override + public JSONB value1() { + return getXjsonbArrayElements(); + } + + @Override + public XjsonbArrayElementsRecord value1(JSONB value) { + setXjsonbArrayElements(value); + return this; + } + + @Override + public XjsonbArrayElementsRecord values(JSONB value1) { + value1(value1); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached XjsonbArrayElementsRecord + */ + public XjsonbArrayElementsRecord() { + super(XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS); + } + + /** + * Create a detached, initialised XjsonbArrayElementsRecord + */ + public XjsonbArrayElementsRecord(JSONB xjsonbArrayElements) { + super(XjsonbArrayElements.XJSONB_ARRAY_ELEMENTS); + + setXjsonbArrayElements(xjsonbArrayElements); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/CodePhrase.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/CodePhrase.java new file mode 100644 index 0000000..ed7f0a6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/CodePhrase.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.udt; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.CodePhraseRecord; +import org.jooq.Schema; +import org.jooq.UDTField; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.SchemaImpl; +import org.jooq.impl.UDTImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CodePhrase extends UDTImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.code_phrase + */ + public static final CodePhrase CODE_PHRASE = new CodePhrase(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CodePhraseRecord.class; + } + + /** + * The attribute ehr.code_phrase.terminology_id_value. + */ + public static final UDTField TERMINOLOGY_ID_VALUE = + createField(DSL.name("terminology_id_value"), SQLDataType.CLOB, CODE_PHRASE, ""); + + /** + * The attribute ehr.code_phrase.code_string. + */ + public static final UDTField CODE_STRING = + createField(DSL.name("code_string"), SQLDataType.CLOB, CODE_PHRASE, ""); + + /** + * No further instances allowed + */ + private CodePhrase() { + super("code_phrase", null, null, false); + } + + @Override + public Schema getSchema() { + return Ehr.EHR != null ? Ehr.EHR : new SchemaImpl(DSL.name("ehr")); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/DvCodedText.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/DvCodedText.java new file mode 100644 index 0000000..9fb3ada --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/DvCodedText.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.udt; + +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.CodePhraseRecord; +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord; +import org.jooq.Schema; +import org.jooq.UDTField; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.SchemaImpl; +import org.jooq.impl.UDTImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class DvCodedText extends UDTImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.dv_coded_text + */ + public static final DvCodedText DV_CODED_TEXT = new DvCodedText(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return DvCodedTextRecord.class; + } + + /** + * The attribute ehr.dv_coded_text.value. + */ + public static final UDTField VALUE = + createField(DSL.name("value"), SQLDataType.CLOB, DV_CODED_TEXT, ""); + + /** + * The attribute ehr.dv_coded_text.defining_code. + */ + public static final UDTField DEFINING_CODE = createField( + DSL.name("defining_code"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(), + DV_CODED_TEXT, + ""); + + /** + * The attribute ehr.dv_coded_text.formatting. + */ + public static final UDTField FORMATTING = + createField(DSL.name("formatting"), SQLDataType.CLOB, DV_CODED_TEXT, ""); + + /** + * The attribute ehr.dv_coded_text.language. + */ + public static final UDTField LANGUAGE = createField( + DSL.name("language"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(), + DV_CODED_TEXT, + ""); + + /** + * The attribute ehr.dv_coded_text.encoding. + */ + public static final UDTField ENCODING = createField( + DSL.name("encoding"), + org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(), + DV_CODED_TEXT, + ""); + + /** + * The attribute ehr.dv_coded_text.term_mapping. + */ + public static final UDTField TERM_MAPPING = + createField(DSL.name("term_mapping"), SQLDataType.CLOB.array(), DV_CODED_TEXT, ""); + + /** + * No further instances allowed + */ + private DvCodedText() { + super("dv_coded_text", null, null, false); + } + + @Override + public Schema getSchema() { + return Ehr.EHR != null ? Ehr.EHR : new SchemaImpl(DSL.name("ehr")); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/CodePhraseRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/CodePhraseRecord.java new file mode 100644 index 0000000..5f592c2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/CodePhraseRecord.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.udt.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.UDTRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class CodePhraseRecord extends UDTRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.code_phrase.terminology_id_value. + */ + public void setTerminologyIdValue(String value) { + set(0, value); + } + + /** + * Getter for ehr.code_phrase.terminology_id_value. + */ + public String getTerminologyIdValue() { + return (String) get(0); + } + + /** + * Setter for ehr.code_phrase.code_string. + */ + public void setCodeString(String value) { + set(1, value); + } + + /** + * Getter for ehr.code_phrase.code_string. + */ + public String getCodeString() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return CodePhrase.TERMINOLOGY_ID_VALUE; + } + + @Override + public Field field2() { + return CodePhrase.CODE_STRING; + } + + @Override + public String component1() { + return getTerminologyIdValue(); + } + + @Override + public String component2() { + return getCodeString(); + } + + @Override + public String value1() { + return getTerminologyIdValue(); + } + + @Override + public String value2() { + return getCodeString(); + } + + @Override + public CodePhraseRecord value1(String value) { + setTerminologyIdValue(value); + return this; + } + + @Override + public CodePhraseRecord value2(String value) { + setCodeString(value); + return this; + } + + @Override + public CodePhraseRecord values(String value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CodePhraseRecord + */ + public CodePhraseRecord() { + super(CodePhrase.CODE_PHRASE); + } + + /** + * Create a detached, initialised CodePhraseRecord + */ + public CodePhraseRecord(String terminologyIdValue, String codeString) { + super(CodePhrase.CODE_PHRASE); + + setTerminologyIdValue(terminologyIdValue); + setCodeString(codeString); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/DvCodedTextRecord.java b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/DvCodedTextRecord.java new file mode 100644 index 0000000..7b474b7 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/exporter/v0/jooq/pg/udt/records/DvCodedTextRecord.java @@ -0,0 +1,307 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.exporter.v0.jooq.pg.udt.records; + +import org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText; +import org.jooq.Field; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UDTRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class DvCodedTextRecord extends UDTRecordImpl + implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.dv_coded_text.value. + */ + public void setValue(String value) { + set(0, value); + } + + /** + * Getter for ehr.dv_coded_text.value. + */ + public String getValue() { + return (String) get(0); + } + + /** + * Setter for ehr.dv_coded_text.defining_code. + */ + public void setDefiningCode(CodePhraseRecord value) { + set(1, value); + } + + /** + * Getter for ehr.dv_coded_text.defining_code. + */ + public CodePhraseRecord getDefiningCode() { + return (CodePhraseRecord) get(1); + } + + /** + * Setter for ehr.dv_coded_text.formatting. + */ + public void setFormatting(String value) { + set(2, value); + } + + /** + * Getter for ehr.dv_coded_text.formatting. + */ + public String getFormatting() { + return (String) get(2); + } + + /** + * Setter for ehr.dv_coded_text.language. + */ + public void setLanguage(CodePhraseRecord value) { + set(3, value); + } + + /** + * Getter for ehr.dv_coded_text.language. + */ + public CodePhraseRecord getLanguage() { + return (CodePhraseRecord) get(3); + } + + /** + * Setter for ehr.dv_coded_text.encoding. + */ + public void setEncoding(CodePhraseRecord value) { + set(4, value); + } + + /** + * Getter for ehr.dv_coded_text.encoding. + */ + public CodePhraseRecord getEncoding() { + return (CodePhraseRecord) get(4); + } + + /** + * Setter for ehr.dv_coded_text.term_mapping. + */ + public void setTermMapping(String[] value) { + set(5, value); + } + + /** + * Getter for ehr.dv_coded_text.term_mapping. + */ + public String[] getTermMapping() { + return (String[]) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return DvCodedText.VALUE; + } + + @Override + public Field field2() { + return DvCodedText.DEFINING_CODE; + } + + @Override + public Field field3() { + return DvCodedText.FORMATTING; + } + + @Override + public Field field4() { + return DvCodedText.LANGUAGE; + } + + @Override + public Field field5() { + return DvCodedText.ENCODING; + } + + @Override + public Field field6() { + return DvCodedText.TERM_MAPPING; + } + + @Override + public String component1() { + return getValue(); + } + + @Override + public CodePhraseRecord component2() { + return getDefiningCode(); + } + + @Override + public String component3() { + return getFormatting(); + } + + @Override + public CodePhraseRecord component4() { + return getLanguage(); + } + + @Override + public CodePhraseRecord component5() { + return getEncoding(); + } + + @Override + public String[] component6() { + return getTermMapping(); + } + + @Override + public String value1() { + return getValue(); + } + + @Override + public CodePhraseRecord value2() { + return getDefiningCode(); + } + + @Override + public String value3() { + return getFormatting(); + } + + @Override + public CodePhraseRecord value4() { + return getLanguage(); + } + + @Override + public CodePhraseRecord value5() { + return getEncoding(); + } + + @Override + public String[] value6() { + return getTermMapping(); + } + + @Override + public DvCodedTextRecord value1(String value) { + setValue(value); + return this; + } + + @Override + public DvCodedTextRecord value2(CodePhraseRecord value) { + setDefiningCode(value); + return this; + } + + @Override + public DvCodedTextRecord value3(String value) { + setFormatting(value); + return this; + } + + @Override + public DvCodedTextRecord value4(CodePhraseRecord value) { + setLanguage(value); + return this; + } + + @Override + public DvCodedTextRecord value5(CodePhraseRecord value) { + setEncoding(value); + return this; + } + + @Override + public DvCodedTextRecord value6(String[] value) { + setTermMapping(value); + return this; + } + + @Override + public DvCodedTextRecord values( + String value1, + CodePhraseRecord value2, + String value3, + CodePhraseRecord value4, + CodePhraseRecord value5, + String[] value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached DvCodedTextRecord + */ + public DvCodedTextRecord() { + super(DvCodedText.DV_CODED_TEXT); + } + + /** + * Create a detached, initialised DvCodedTextRecord + */ + public DvCodedTextRecord( + String value, + CodePhraseRecord definingCode, + String formatting, + CodePhraseRecord language, + CodePhraseRecord encoding, + String[] termMapping) { + super(DvCodedText.DV_CODED_TEXT); + + setValue(value); + setDefiningCode(definingCode); + setFormatting(formatting); + setLanguage(language); + setEncoding(encoding); + setTermMapping(termMapping); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/AuditDetailsTargetType.java b/service/src/main/java/org/ehrbase/migration/importer/v4/AuditDetailsTargetType.java new file mode 100644 index 0000000..9079a2a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/AuditDetailsTargetType.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +public enum AuditDetailsTargetType { + CONTRIBUTION("CT"), + COMPOSITION("CO"), + EHR_STATUS("ES"), + EHR_FOLDER("EF"); + + private final String alias; + + AuditDetailsTargetType(String alias) { + this.alias = alias; + } + + public String getAlias() { + return alias; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/AuditImporter.java b/service/src/main/java/org/ehrbase/migration/importer/v4/AuditImporter.java new file mode 100644 index 0000000..4a89a94 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/AuditImporter.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.AUDIT_DETAILS; + +import com.nedap.archie.rm.datavalues.DvText; +import com.nedap.archie.rm.generic.AuditDetails; +import com.nedap.archie.rm.generic.PartyProxy; +import java.time.OffsetDateTime; +import java.util.Collection; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiConsumer; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionChangeType; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.CanonicalJson; +import org.jooq.DSLContext; +import org.jooq.JSONB; + +public class AuditImporter { + + private final DSLContext dslContext; + + public AuditImporter(DSLContext dslContext) { + this.dslContext = dslContext; + } + + public void addAudit( + Function getUuid, + BiConsumer setAudit, + Collection> rootRecords, + AuditDetailsTargetType targetType, + EhrSchemaData ehrSchemaData) { + + Map> collect = + rootRecords.stream().collect(Collectors.toMap(p -> getUuid.apply(p.getLeft()), Function.identity())); + + Map written = write( + collect.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue() + .getValue())), + targetType, + ehrSchemaData); + + written.forEach((k, v) -> setAudit.accept(collect.get(k).getLeft(), v)); + } + + protected Map write( + Map auditDetailsMap, AuditDetailsTargetType targetType, EhrSchemaData ehrSchemaData) { + + Map collect = auditDetailsMap.entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, e -> toRecord(e.getValue(), targetType, ehrSchemaData))); + + ImportService.executeBulkInsert(dslContext, collect.values().stream(), AUDIT_DETAILS); + + return collect.entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getId())); + } + + private AuditDetailsRecord toRecord( + AuditDetails auditDetails, AuditDetailsTargetType targetType, EhrSchemaData ehrSchemaData) { + + AuditDetailsRecord auditDetailsRecord = dslContext.newRecord(AUDIT_DETAILS); + + auditDetailsRecord.setDescription(Optional.of(auditDetails) + .map(AuditDetails::getDescription) + .map(DvText::getValue) + .orElse(null)); + auditDetailsRecord.setChangeType(ContributionChangeType.valueOf( + auditDetails.getChangeType().getValue().toLowerCase())); + + auditDetailsRecord.setTimeCommitted( + OffsetDateTime.from(auditDetails.getTimeCommitted().getValue())); + auditDetailsRecord.setTargetType(targetType.getAlias()); + auditDetailsRecord.setId(UUID.randomUUID()); + + Pair user = ehrSchemaData.findCommitterUser(auditDetails.getCommitter(), dslContext); + + if (user.getRight() != null) { + auditDetailsRecord.setCommitter(JSONB.valueOf(new CanonicalJson().marshal(user.getRight()))); + } + auditDetailsRecord.setUserId(user.getLeft()); + + return auditDetailsRecord; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/ContributionImporter.java b/service/src/main/java/org/ehrbase/migration/importer/v4/ContributionImporter.java new file mode 100644 index 0000000..abdcca8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/ContributionImporter.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import static org.ehrbase.migration.importer.v4.jooq.pg.tables.Contribution.CONTRIBUTION; + +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.generic.AuditDetails; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.ContributionRecord; +import org.jooq.DSLContext; + +public class ContributionImporter { + + private final DSLContext dslContext; + + private final AuditImporter auditImporter; + + public ContributionImporter(DSLContext dslContext) { + this.dslContext = dslContext; + auditImporter = new AuditImporter(dslContext); + } + + protected void write(Map> contributionMap, EhrSchemaData ehrSchemaData) { + + List> collect = contributionMap.entrySet().stream() + .flatMap(e -> e.getValue().stream().map(v -> Pair.of(e.getKey(), v))) + .map(p -> Pair.of(to(p.getValue(), p.getKey()), p.getValue().getAudit())) + .toList(); + + auditImporter.addAudit( + ContributionRecord::getId, + ContributionRecord::setHasAudit, + collect, + AuditDetailsTargetType.CONTRIBUTION, + ehrSchemaData); + + ImportService.executeBulkInsert(dslContext, collect.stream().map(Pair::getKey), CONTRIBUTION); + } + + private ContributionRecord to(Contribution contribution, UUID ehrId) { + + ContributionRecord contributionRecord = dslContext.newRecord(CONTRIBUTION); + contributionRecord.setId(UUID.fromString(contribution.getUid().getValue())); + contributionRecord.setEhrId(ehrId); + + return contributionRecord; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/EhrImporter.java b/service/src/main/java/org/ehrbase/migration/importer/v4/EhrImporter.java new file mode 100644 index 0000000..8e97e60 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/EhrImporter.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import static org.ehrbase.migration.importer.v4.ImportService.executeBulkInsert; +import static org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr.EHR_; + +import java.time.OffsetDateTime; +import java.util.List; +import java.util.stream.Stream; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrRecord; +import org.jooq.DSLContext; + +public class EhrImporter { + + private final DSLContext dslContext; + + public EhrImporter(DSLContext dslContext) { + this.dslContext = dslContext; + } + + public void writeEhr(List ehrs) { + + Stream records = ehrs.stream().map(this::to); + + executeBulkInsert(dslContext, records, EHR_); + } + + private EhrRecord to(ExtendedEhr extendedEhr) { + + EhrRecord ehrRecord = dslContext.newRecord(EHR_); + + ehrRecord.setId(extendedEhr.getEhrId()); + ehrRecord.setCreationDate( + OffsetDateTime.from(extendedEhr.getTimeCreated().getValue())); + + return ehrRecord; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaDataImporter.java b/service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaDataImporter.java new file mode 100644 index 0000000..2d612c4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaDataImporter.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import static org.ehrbase.migration.MigrationUtils.getPartyProxyUuid; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.TEMPLATE_STORE; +import static org.ehrbase.migration.importer.v4.jooq.pg.tables.Users.USERS; + +import java.time.ZoneOffset; +import java.util.UUID; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.User; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.TemplateStoreRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.UsersRecord; +import org.jooq.DSLContext; + +public class EhrSchemaDataImporter { + + private final DSLContext dslContext; + + public EhrSchemaDataImporter(DSLContext dslContext) { + this.dslContext = dslContext; + } + + protected void write(EhrSchemaData ehrSchemaData) { + + ImportService.executeBulkInsert( + dslContext, ehrSchemaData.getUsers().stream().map(this::toUserRecord), USERS); + + // Create anonymousUser if not exist + if (ehrSchemaData.getUsers().stream().noneMatch(u -> u.getUsername().equals(EhrSchemaData.ANONYMOUS_USER))) { + UsersRecord usersRecord = dslContext.newRecord(USERS); + usersRecord.setId(UUID.randomUUID()); + usersRecord.setUsername(EhrSchemaData.ANONYMOUS_USER); + usersRecord.store(); + } + + ImportService.executeBulkInsert( + dslContext, + ehrSchemaData.streamTemplates().map(t -> toTemplateRecord(ehrSchemaData.getTemplateUuid(t), t)), + TEMPLATE_STORE); + } + + private TemplateStoreRecord toTemplateRecord(UUID id, EhrSchemaData.TemplateData templateData) { + + TemplateStoreRecord templateStoreRecord = dslContext.newRecord(TEMPLATE_STORE); + + templateStoreRecord.setId(id); + templateStoreRecord.setTemplateId(templateData.templateId()); + templateStoreRecord.setContent(templateData.content()); + templateStoreRecord.setCreationTime( + templateData.creation().toLocalDateTime().atOffset(ZoneOffset.UTC)); + + return templateStoreRecord; + } + + private UsersRecord toUserRecord(User user) { + + UsersRecord usersRecord = dslContext.newRecord(USERS); + + usersRecord.setUsername(user.getUsername()); + usersRecord.setId(getPartyProxyUuid(user.getPartyIdentified())); + return usersRecord; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaImporter.java b/service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaImporter.java new file mode 100644 index 0000000..543ed82 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/EhrSchemaImporter.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.COMP_DATA; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.COMP_DATA_HISTORY; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.COMP_VERSION; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.COMP_VERSION_HISTORY; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_FOLDER_DATA; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_FOLDER_DATA_HISTORY; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_FOLDER_VERSION; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_FOLDER_VERSION_HISTORY; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_STATUS_DATA; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_STATUS_DATA_HISTORY; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_STATUS_VERSION; +import static org.ehrbase.migration.importer.v4.jooq.pg.Tables.EHR_STATUS_VERSION_HISTORY; + +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.jooq.DSLContext; + +public class EhrSchemaImporter { + + private final EhrSchemaDataImporter ehrSchemaDataImporter; + + private final EhrImporter ehrImporter; + private final ContributionImporter contributionImporter; + private final LocatableImporter locatableImporter; + + public EhrSchemaImporter(DSLContext dslContext) { + this.ehrSchemaDataImporter = new EhrSchemaDataImporter(dslContext); + this.ehrImporter = new EhrImporter(dslContext); + this.contributionImporter = new ContributionImporter(dslContext); + this.locatableImporter = new LocatableImporter(dslContext); + } + + public void writeEhrSchemaData(EhrSchemaData ehrSchemaData) { + ehrSchemaDataImporter.write(ehrSchemaData); + } + + public void writeEhr(List ehrs) { + ehrImporter.writeEhr(ehrs); + } + + public void writeContribution(Map> contributions, EhrSchemaData ehrSchemaData) { + contributionImporter.write(contributions, ehrSchemaData); + } + + public void writeStatus(ImportService.VersionedObjectByEhr statusMap, EhrSchemaData ehrSchemaData) { + + locatableImporter.write( + statusMap, + AuditDetailsTargetType.EHR_STATUS, + EHR_STATUS_VERSION, + EHR_STATUS_DATA, + EHR_STATUS_VERSION_HISTORY, + EHR_STATUS_DATA_HISTORY, + ehrSchemaData, + null); + } + + public void writeEhrFolder(ImportService.VersionedObjectByEhr statusMap, EhrSchemaData ehrSchemaData) { + locatableImporter.write( + statusMap, + AuditDetailsTargetType.EHR_FOLDER, + EHR_FOLDER_VERSION, + EHR_FOLDER_DATA, + EHR_FOLDER_VERSION_HISTORY, + EHR_FOLDER_DATA_HISTORY, + ehrSchemaData, + null); + } + + public void writeComposition( + ImportService.VersionedObjectByEhr statusMap, + EhrSchemaData ehrSchemaData, + Function templateIdToUuid) { + locatableImporter.write( + statusMap, + AuditDetailsTargetType.COMPOSITION, + COMP_VERSION, + COMP_DATA, + COMP_VERSION_HISTORY, + COMP_DATA_HISTORY, + ehrSchemaData, + templateIdToUuid); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/FlywayConfig.java b/service/src/main/java/org/ehrbase/migration/importer/v4/FlywayConfig.java new file mode 100644 index 0000000..195cee9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/FlywayConfig.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import javax.sql.DataSource; +import org.flywaydb.core.Flyway; +import org.flywaydb.core.api.configuration.FluentConfiguration; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FlywayConfig { + + @Bean + Flyway flyway(@Qualifier("importDataSource") DataSource dataSource) { + FluentConfiguration configuration = + new FluentConfiguration(this.getClass().getClassLoader()); + + configuration.dataSource(dataSource); + + return configuration.load(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/FlywayService.java b/service/src/main/java/org/ehrbase/migration/importer/v4/FlywayService.java new file mode 100644 index 0000000..8c65a95 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/FlywayService.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import java.util.Map; +import java.util.Optional; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.sql.DataSource; +import org.apache.commons.lang3.StringUtils; +import org.flywaydb.core.Flyway; +import org.flywaydb.core.api.configuration.FluentConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; +import org.springframework.stereotype.Service; + +@Service +public class FlywayService { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + private final Flyway flyway; + + @Value("${spring.flyway.ehr-location:classpath:db/migration/ehr}") + private String ehrLocation; + + @Value("${spring.flyway.ext-location:classpath:db/migration/ext}") + private String extLocation; + + @Value("${import.ehrbase-db-user}") + private String dbUser; + + public FlywayService(Flyway flyway) { + this.flyway = flyway; + } + + public void migrateExtSchema() { + migrateSchema("ext", extLocation, "1", "extSchema"); + } + + public void migrateEhrSchema(String schema) { + migrateSchema(schema, ehrLocation, null, "ehrSchema"); + } + + public void migrateSchema( + @Nonnull String schema, + @Nonnull String location, + @Nullable String baseline, + @Nullable String schemaPlaceholder) { + FluentConfiguration config = + Flyway.configure().dataSource(getDataSource()).schemas(schema).locations(location); + + Optional.ofNullable(baseline).filter(StringUtils::isNoneBlank).ifPresent(b -> config.baselineOnMigrate(true) + .baselineVersion(b)); + + Optional.ofNullable(schemaPlaceholder) + .filter(StringUtils::isNoneBlank) + .ifPresent(b -> config.placeholders(Map.of(schemaPlaceholder, schema))); + + config.load().migrate(); + } + + private DataSource getDataSource() { + return flyway.getConfiguration().getDataSource(); + } + + public void executeStatements(String... statements) { + logger.warn("DBUser: {}", dbUser); + NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(getDataSource()); + MapSqlParameterSource paramSource = new MapSqlParameterSource("dbUser", dbUser); + + for (String statement : statements) { + jdbcTemplate.execute(statement, paramSource, ps -> null); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/ImportService.java b/service/src/main/java/org/ehrbase/migration/importer/v4/ImportService.java new file mode 100644 index 0000000..b302300 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/ImportService.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import com.nedap.archie.rm.archetyped.Locatable; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.jooq.DSLContext; +import org.jooq.Loader; +import org.jooq.Record; +import org.jooq.Table; + +public interface ImportService { + + static void executeBulkInsert(DSLContext context, Stream recordStream, Table table) { + + try { + Loader execute = context.loadInto(table) + .bulkAfter(500) + .loadRecords(recordStream) + .fields(table.fields()) + .execute(); + + if (!execute.result().errors().isEmpty()) { + throw new RuntimeException(execute.result().errors().stream() + .map(e -> e.exception().getMessage()) + .collect(Collectors.joining(";"))); + } + } catch (IOException e) { + throw new UncheckedIOException(e.getMessage(), e); + } + } + + EhrSchemaImporter createImporter(EhrSchema ehrSchema, String schemaName); + + class VersionedObjectByEhr { + + private final List extendedEhrs; + private final Function>> extractor; + + public VersionedObjectByEhr( + List extendedEhrs, Function>> extractor) { + this.extendedEhrs = extendedEhrs; + this.extractor = extractor; + } + + public Stream>> streamOriginalVersions() { + return extendedEhrs.stream().flatMap(e -> Optional.ofNullable(extractor.apply(e)).orElse(List.of()).stream() + .map(l -> Pair.of(e.getEhrId(), l))); + } + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/ImportServiceImpl.java b/service/src/main/java/org/ehrbase/migration/importer/v4/ImportServiceImpl.java new file mode 100644 index 0000000..17180e1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/ImportServiceImpl.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import jakarta.annotation.PostConstruct; +import org.ehrbase.migration.dto.EhrSchema; +import org.jooq.ConnectionProvider; +import org.jooq.SQLDialect; +import org.jooq.impl.DefaultConfiguration; +import org.jooq.impl.DefaultDSLContext; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +@Service +public class ImportServiceImpl implements ImportService { + + protected final FlywayService flywayService; + + protected final ConnectionProvider connectionProvider; + + public ImportServiceImpl( + FlywayService flywayService, @Qualifier("importConnectionProvider") ConnectionProvider connectionProvider) { + this.flywayService = flywayService; + this.connectionProvider = connectionProvider; + } + + @PostConstruct + protected void init() { + flywayService.migrateExtSchema(); + } + + @Override + public EhrSchemaImporter createImporter(EhrSchema ehrSchema, String schemaName) { + flywayService.migrateEhrSchema(schemaName); + + return new EhrSchemaImporter(new DefaultDSLContext(createDefaultConfiguration(ehrSchema, schemaName))); + } + + protected DefaultConfiguration createDefaultConfiguration(EhrSchema ehrSchema, String schemaName) { + DefaultConfiguration defaultConfiguration = new DefaultConfiguration(); + defaultConfiguration.set(connectionProvider); + defaultConfiguration.set(SQLDialect.POSTGRES); + return defaultConfiguration; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/LocatableImporter.java b/service/src/main/java/org/ehrbase/migration/importer/v4/LocatableImporter.java new file mode 100644 index 0000000..bc19233 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/LocatableImporter.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4; + +import static org.ehrbase.api.service.DirectoryService.EHR_DIRECTORY_FOLDER_IDX; +import static org.ehrbase.openehr.dbformat.jooq.prototypes.ObjectVersionHistoryTablePrototype.INSTANCE; + +import com.nedap.archie.rm.archetyped.Locatable; +import com.nedap.archie.rm.changecontrol.OriginalVersion; +import com.nedap.archie.rm.changecontrol.Version; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import com.nedap.archie.rm.support.identification.ObjectVersionId; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang3.tuple.Pair; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.v0.AuditExporter; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusData; +import org.ehrbase.openehr.aqlengine.asl.model.AslRmTypeAndConcept; +import org.ehrbase.openehr.dbformat.jooq.prototypes.ObjectDataRecordPrototype; +import org.ehrbase.repository.VersionDataDbRecord; +import org.jooq.DSLContext; +import org.jooq.Record; +import org.jooq.Table; + +public class LocatableImporter { + + private final DSLContext dslContext; + private final AuditImporter auditImporter; + + public LocatableImporter(DSLContext dslContext) { + this.dslContext = dslContext; + auditImporter = new AuditImporter(dslContext); + } + + protected void write( + ImportService.VersionedObjectByEhr versionedObjects, + AuditDetailsTargetType targetType, + Table versionHead, + Table dataHead, + Table versionHistory, + Table dataHistory, + EhrSchemaData ehrSchemaData, + Function templateIdToUuid) { + + var auditDetailsMap = versionedObjects + .streamOriginalVersions() + .map(Pair::getRight) + .map(VersionedObjectData::originalVersions) + .flatMap(Set::stream) + .collect(Collectors.toMap( + OriginalVersion::getUid, + Version::getCommitAudit, + (a, b) -> { + throw new IllegalStateException(); + }, + LinkedHashMap::new)); + + Map auditUuids = auditImporter.write(auditDetailsMap, targetType, ehrSchemaData); + + List versionList = new ArrayList<>(); + List versionHistoryList = new ArrayList<>(); + List dataList = new ArrayList<>(); + List dataHistoryList = new ArrayList<>(); + + versionedObjects.streamOriginalVersions().forEach(ev -> { + VersionedObjectRecords records = to( + ev.getRight().originalVersions(), + ev.getLeft(), + auditUuids, + versionHead, + dataHead, + versionHistory, + dataHistory, + templateIdToUuid); + + versionList.addAll(records.versionList); + versionHistoryList.addAll(records.versionHistoryList); + dataList.addAll(records.dataList); + dataHistoryList.addAll(records.dataHistoryList); + }); + + ImportService.executeBulkInsert(dslContext, versionList.stream(), versionHead); + ImportService.executeBulkInsert(dslContext, versionHistoryList.stream(), versionHistory); + ImportService.executeBulkInsert(dslContext, dataList.stream(), dataHead); + ImportService.executeBulkInsert(dslContext, dataHistoryList.stream(), dataHistory); + } + + private record VersionedObjectRecords( + List versionList, + List versionHistoryList, + List dataList, + List dataHistoryList) {} + + protected VersionedObjectRecords to( + SortedSet> statusVersions, + UUID ehrId, + Map auditUuids, + Table versionHead, + Table dataHead, + Table versionHistory, + Table dataHistory, + Function templateIdToUuid) { + + List versionList = new ArrayList<>(); + List versionHistoryList = new ArrayList<>(); + List dataList = new ArrayList<>(); + List dataHistoryList = new ArrayList<>(); + + L initialData = statusVersions.getFirst().getData(); + + Record lastroot = null; + for (OriginalVersion current : statusVersions.reversed()) { + List nextData = new ArrayList<>(); + + Record nextroot; + + String codeString = + current.getCommitAudit().getChangeType().getDefiningCode().getCodeString(); + if (codeString.equals("" + AuditExporter.ContributionChangeType.DELETED.getCode())) { + + var root = dslContext.newRecord(versionHistory); + + root.setValue(INSTANCE.EHR_ID, ehrId); + root.setValue( + INSTANCE.VO_ID, + UUID.fromString(initialData.getUid().getRoot().getValue())); + + root.set(INSTANCE.SYS_DELETED, true); + + nextroot = root; + + } else { + + VersionDataDbRecord records = VersionDataDbRecord.toRecords( + ehrId, + current.getData(), + UUID.fromString(current.getContribution().getId().getValue()), + auditUuids.get(current.getUid()), + null, + dslContext); + + Stream versionedObjectRecordPrototypes = + records.dataRecords().get(); + + Table dataTable; + Table versionTable; + if (lastroot == null) { + dataTable = dataHead; + versionTable = versionHead; + } else { + dataTable = dataHistory; + versionTable = versionHistory; + } + versionedObjectRecordPrototypes.forEach(r -> nextData.add(r.into(dataTable))); + nextroot = records.versionRecord().into(versionTable); + } + + OffsetDateTime from = OffsetDateTime.from( + current.getCommitAudit().getTimeCommitted().getValue()); + final OffsetDateTime to; + + if (lastroot != null) { + + to = lastroot.get(INSTANCE.SYS_PERIOD_LOWER); + } else { + to = null; + } + + nextData.forEach(r -> { + if (dataHistory.getRecordType().isInstance(r)) { + r.set( + INSTANCE.SYS_VERSION, + Integer.parseInt(current.getUid().getVersionTreeId().getValue())); + } + + if (current.getData() instanceof Folder) { + r.setValue(EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_FOLDERS_IDX, EHR_DIRECTORY_FOLDER_IDX); + r.setValue(EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_ID, ehrId); + } + if (current.getData() instanceof EhrStatus) { + r.setValue(EhrStatusData.EHR_STATUS_DATA.EHR_ID, ehrId); + } + }); + + nextroot.set( + INSTANCE.SYS_VERSION, + Integer.parseInt(current.getUid().getVersionTreeId().getValue())); + nextroot.set(INSTANCE.AUDIT_ID, auditUuids.get(current.getUid())); + nextroot.set( + INSTANCE.CONTRIBUTION_ID, + UUID.fromString(current.getContribution().getId().getValue())); + nextroot.set(INSTANCE.SYS_PERIOD_LOWER, from); + + if (to != null) { + nextroot.set(INSTANCE.SYS_PERIOD_UPPER, to); + if (nextroot.getValue(INSTANCE.SYS_DELETED) == null) { + nextroot.setValue(INSTANCE.SYS_DELETED, false); + } + } + + if (initialData instanceof Composition composition) { + String rootConcept = AslRmTypeAndConcept.toEntityConcept(composition.getArchetypeNodeId()); + nextroot.setValue(CompVersion.COMP_VERSION.ROOT_CONCEPT, rootConcept); + nextroot.setValue( + CompVersion.COMP_VERSION.TEMPLATE_ID, + templateIdToUuid.apply(composition + .getArchetypeDetails() + .getTemplateId() + .getValue())); + } + + if (current.getData() instanceof Folder) { + nextroot.setValue( + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_FOLDERS_IDX, EHR_DIRECTORY_FOLDER_IDX); + } + + lastroot = nextroot; + + if (versionHistory.getRecordType().isInstance(nextroot)) { + + dataHistoryList.addAll(nextData); + versionHistoryList.add(nextroot); + } else { + dataList.addAll(nextData); + versionList.add(nextroot); + } + } + + return new VersionedObjectRecords(versionList, versionHistoryList, dataList, dataHistoryList); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/DefaultCatalog.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/DefaultCatalog.java new file mode 100644 index 0000000..45862a9 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/DefaultCatalog.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg; + +import java.util.Arrays; +import java.util.List; +import org.jooq.Constants; +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class DefaultCatalog extends CatalogImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of DEFAULT_CATALOG + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema ehr. + */ + public final Ehr EHR = Ehr.EHR; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + return Arrays.asList(Ehr.EHR); + } + + /** + * A reference to the 3.18 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.18. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18; +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Ehr.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Ehr.java new file mode 100644 index 0000000..10fa7a4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Ehr.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg; + +import java.util.Arrays; +import java.util.List; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.AuditDetails; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Contribution; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Plugin; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.StoredQuery; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Users; +import org.jooq.Catalog; +import org.jooq.Sequence; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Ehr extends SchemaImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr + */ + public static final Ehr EHR = new Ehr(); + + /** + * The table ehr.audit_details. + */ + public final AuditDetails AUDIT_DETAILS = AuditDetails.AUDIT_DETAILS; + + /** + * The table ehr.comp_data. + */ + public final CompData COMP_DATA = CompData.COMP_DATA; + + /** + * The table ehr.comp_data_history. + */ + public final CompDataHistory COMP_DATA_HISTORY = CompDataHistory.COMP_DATA_HISTORY; + + /** + * The table ehr.comp_version. + */ + public final CompVersion COMP_VERSION = CompVersion.COMP_VERSION; + + /** + * The table ehr.comp_version_history. + */ + public final CompVersionHistory COMP_VERSION_HISTORY = CompVersionHistory.COMP_VERSION_HISTORY; + + /** + * The table ehr.contribution. + */ + public final Contribution CONTRIBUTION = Contribution.CONTRIBUTION; + + /** + * The table ehr.ehr. + */ + public final org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr EHR_ = + org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr.EHR_; + + /** + * The table ehr.ehr_folder_data. + */ + public final EhrFolderData EHR_FOLDER_DATA = EhrFolderData.EHR_FOLDER_DATA; + + /** + * The table ehr.ehr_folder_data_history. + */ + public final EhrFolderDataHistory EHR_FOLDER_DATA_HISTORY = EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY; + + /** + * The table ehr.ehr_folder_version. + */ + public final EhrFolderVersion EHR_FOLDER_VERSION = EhrFolderVersion.EHR_FOLDER_VERSION; + + /** + * The table ehr.ehr_folder_version_history. + */ + public final EhrFolderVersionHistory EHR_FOLDER_VERSION_HISTORY = + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY; + + /** + * The table ehr.ehr_status_data. + */ + public final EhrStatusData EHR_STATUS_DATA = EhrStatusData.EHR_STATUS_DATA; + + /** + * The table ehr.ehr_status_data_history. + */ + public final EhrStatusDataHistory EHR_STATUS_DATA_HISTORY = EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY; + + /** + * The table ehr.ehr_status_version. + */ + public final EhrStatusVersion EHR_STATUS_VERSION = EhrStatusVersion.EHR_STATUS_VERSION; + + /** + * The table ehr.ehr_status_version_history. + */ + public final EhrStatusVersionHistory EHR_STATUS_VERSION_HISTORY = + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY; + + /** + * The table ehr.flyway_schema_history. + */ + public final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY; + + /** + * key value store for plugin sub system + */ + public final Plugin PLUGIN = Plugin.PLUGIN; + + /** + * The table ehr.stored_query. + */ + public final StoredQuery STORED_QUERY = StoredQuery.STORED_QUERY; + + /** + * The table ehr.template_store. + */ + public final TemplateStore TEMPLATE_STORE = TemplateStore.TEMPLATE_STORE; + + /** + * The table ehr.users. + */ + public final Users USERS = Users.USERS; + + /** + * No further instances allowed + */ + private Ehr() { + super("ehr", null); + } + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getSequences() { + return Arrays.asList(Sequences.TENANT_ID_SEQ); + } + + @Override + public final List> getTables() { + return Arrays.asList( + AuditDetails.AUDIT_DETAILS, + CompData.COMP_DATA, + CompDataHistory.COMP_DATA_HISTORY, + CompVersion.COMP_VERSION, + CompVersionHistory.COMP_VERSION_HISTORY, + Contribution.CONTRIBUTION, + org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr.EHR_, + EhrFolderData.EHR_FOLDER_DATA, + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY, + EhrFolderVersion.EHR_FOLDER_VERSION, + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY, + EhrStatusData.EHR_STATUS_DATA, + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY, + EhrStatusVersion.EHR_STATUS_VERSION, + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY, + FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + Plugin.PLUGIN, + StoredQuery.STORED_QUERY, + TemplateStore.TEMPLATE_STORE, + Users.USERS); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Indexes.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Indexes.java new file mode 100644 index 0000000..780dadc --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Indexes.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg; + +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Contribution; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Users; +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +/** + * A class modelling indexes of tables in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index COMP_DATA_LEAF_IDX = Internal.createIndex( + DSL.name("comp_data_leaf_idx"), + CompData.COMP_DATA, + new OrderField[] {CompData.COMP_DATA.VO_ID, CompData.COMP_DATA.ENTITY_IDX}, + false); + public static final Index COMP_VERSION_SYS_PERIOD_LOWER_IDX = Internal.createIndex( + DSL.name("comp_version_sys_period_lower_idx"), + CompVersion.COMP_VERSION, + new OrderField[] {CompVersion.COMP_VERSION.SYS_PERIOD_LOWER.desc(), CompVersion.COMP_VERSION.VO_ID}, + false); + public static final Index CONTRIBUTION_EHR_IDX = Internal.createIndex( + DSL.name("contribution_ehr_idx"), + Contribution.CONTRIBUTION, + new OrderField[] {Contribution.CONTRIBUTION.EHR_ID}, + false); + public static final Index EHR_STATUS_VERSION_SYS_PERIOD_LOWER_IDX = Internal.createIndex( + DSL.name("ehr_status_version_sys_period_lower_idx"), + EhrStatusVersion.EHR_STATUS_VERSION, + new OrderField[] { + EhrStatusVersion.EHR_STATUS_VERSION.SYS_PERIOD_LOWER.desc(), EhrStatusVersion.EHR_STATUS_VERSION.EHR_ID + }, + false); + public static final Index FLYWAY_SCHEMA_HISTORY_S_IDX = Internal.createIndex( + DSL.name("flyway_schema_history_s_idx"), + FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + new OrderField[] {FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SUCCESS}, + false); + public static final Index TEMPLATE_STORE_ID_UNQ = Internal.createIndex( + DSL.name("template_store_id_unq"), + TemplateStore.TEMPLATE_STORE, + new OrderField[] {TemplateStore.TEMPLATE_STORE.TEMPLATE_ID}, + true); + public static final Index USERS_USERNAME_IDX = Internal.createIndex( + DSL.name("users_username_idx"), Users.USERS, new OrderField[] {Users.USERS.USERNAME}, true); +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Keys.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Keys.java new file mode 100644 index 0000000..0fec060 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Keys.java @@ -0,0 +1,494 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg; + +import org.ehrbase.migration.importer.v4.jooq.pg.tables.AuditDetails; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Contribution; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Plugin; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.StoredQuery; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Users; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.AuditDetailsRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompDataHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompDataRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompVersionHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompVersionRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.ContributionRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderDataHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderDataRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderVersionHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderVersionRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusDataHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusDataRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusVersionHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusVersionRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.FlywaySchemaHistoryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.PluginRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.StoredQueryRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.TemplateStoreRecord; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.UsersRecord; +import org.jooq.ForeignKey; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +/** + * A class modelling foreign key relationships and constraints of tables in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Keys { + + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- + + public static final UniqueKey AUDIT_DETAILS_PKEY = Internal.createUniqueKey( + AuditDetails.AUDIT_DETAILS, + DSL.name("audit_details_pkey"), + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final UniqueKey COMP_PKEY = Internal.createUniqueKey( + CompData.COMP_DATA, + DSL.name("comp_pkey"), + new TableField[] {CompData.COMP_DATA.VO_ID, CompData.COMP_DATA.NUM}, + true); + public static final UniqueKey COMP_HISTORY_PKEY = Internal.createUniqueKey( + CompDataHistory.COMP_DATA_HISTORY, + DSL.name("comp_history_pkey"), + new TableField[] { + CompDataHistory.COMP_DATA_HISTORY.VO_ID, + CompDataHistory.COMP_DATA_HISTORY.NUM, + CompDataHistory.COMP_DATA_HISTORY.SYS_VERSION + }, + true); + public static final UniqueKey COMP_VERSION_PKEY = Internal.createUniqueKey( + CompVersion.COMP_VERSION, + DSL.name("comp_version_pkey"), + new TableField[] {CompVersion.COMP_VERSION.VO_ID}, + true); + public static final UniqueKey COMP_VERSION_HISTORY_PKEY = Internal.createUniqueKey( + CompVersionHistory.COMP_VERSION_HISTORY, + DSL.name("comp_version_history_pkey"), + new TableField[] { + CompVersionHistory.COMP_VERSION_HISTORY.VO_ID, CompVersionHistory.COMP_VERSION_HISTORY.SYS_VERSION + }, + true); + public static final UniqueKey CONTRIBUTION_PKEY = Internal.createUniqueKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_pkey"), + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final UniqueKey EHR_PKEY = + Internal.createUniqueKey(Ehr.EHR_, DSL.name("ehr_pkey"), new TableField[] {Ehr.EHR_.ID}, true); + public static final UniqueKey EHR_FOLDER_PKEY = Internal.createUniqueKey( + EhrFolderData.EHR_FOLDER_DATA, + DSL.name("ehr_folder_pkey"), + new TableField[] { + EhrFolderData.EHR_FOLDER_DATA.EHR_ID, + EhrFolderData.EHR_FOLDER_DATA.EHR_FOLDERS_IDX, + EhrFolderData.EHR_FOLDER_DATA.NUM + }, + true); + public static final UniqueKey EHR_FOLDER_HISTORY_PKEY = Internal.createUniqueKey( + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY, + DSL.name("ehr_folder_history_pkey"), + new TableField[] { + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_ID, + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_FOLDERS_IDX, + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.NUM, + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.SYS_VERSION + }, + true); + public static final UniqueKey EHR_FOLDER_VERSION_PKEY = Internal.createUniqueKey( + EhrFolderVersion.EHR_FOLDER_VERSION, + DSL.name("ehr_folder_version_pkey"), + new TableField[] { + EhrFolderVersion.EHR_FOLDER_VERSION.EHR_ID, EhrFolderVersion.EHR_FOLDER_VERSION.EHR_FOLDERS_IDX + }, + true); + public static final UniqueKey EHR_FOLDER_VERSION_HISTORY_PKEY = + Internal.createUniqueKey( + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY, + DSL.name("ehr_folder_version_history_pkey"), + new TableField[] { + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_ID, + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_FOLDERS_IDX, + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.SYS_VERSION + }, + true); + public static final UniqueKey EHR_STATUS_PKEY = Internal.createUniqueKey( + EhrStatusData.EHR_STATUS_DATA, + DSL.name("ehr_status_pkey"), + new TableField[] {EhrStatusData.EHR_STATUS_DATA.EHR_ID, EhrStatusData.EHR_STATUS_DATA.NUM}, + true); + public static final UniqueKey EHR_STATUS_HISTORY_PKEY = Internal.createUniqueKey( + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY, + DSL.name("ehr_status_history_pkey"), + new TableField[] { + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.EHR_ID, + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.NUM, + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.SYS_VERSION + }, + true); + public static final UniqueKey EHR_STATUS_VERSION_PKEY = Internal.createUniqueKey( + EhrStatusVersion.EHR_STATUS_VERSION, + DSL.name("ehr_status_version_pkey"), + new TableField[] {EhrStatusVersion.EHR_STATUS_VERSION.EHR_ID}, + true); + public static final UniqueKey EHR_STATUS_VERSION_HISTORY_PKEY = + Internal.createUniqueKey( + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY, + DSL.name("ehr_status_version_history_pkey"), + new TableField[] { + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.EHR_ID, + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.SYS_VERSION + }, + true); + public static final UniqueKey FLYWAY_SCHEMA_HISTORY_PK = Internal.createUniqueKey( + FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + DSL.name("flyway_schema_history_pk"), + new TableField[] {FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_RANK}, + true); + public static final UniqueKey PLUGIN_PKEY = + Internal.createUniqueKey(Plugin.PLUGIN, DSL.name("plugin_pkey"), new TableField[] {Plugin.PLUGIN.ID}, true); + public static final UniqueKey STORED_QUERY_PKEY = Internal.createUniqueKey( + StoredQuery.STORED_QUERY, + DSL.name("stored_query_pkey"), + new TableField[] { + StoredQuery.STORED_QUERY.REVERSE_DOMAIN_NAME, + StoredQuery.STORED_QUERY.SEMANTIC_ID, + StoredQuery.STORED_QUERY.SEMVER + }, + true); + public static final UniqueKey TEMPLATE_STORE_PKEY = Internal.createUniqueKey( + TemplateStore.TEMPLATE_STORE, + DSL.name("template_store_pkey"), + new TableField[] {TemplateStore.TEMPLATE_STORE.ID}, + true); + public static final UniqueKey USERS_PKEY = + Internal.createUniqueKey(Users.USERS, DSL.name("users_pkey"), new TableField[] {Users.USERS.ID}, true); + + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- + + public static final ForeignKey AUDIT_DETAILS__AUDIT_DETAILS_USER_ID_FKEY = + Internal.createForeignKey( + AuditDetails.AUDIT_DETAILS, + DSL.name("audit_details_user_id_fkey"), + new TableField[] {AuditDetails.AUDIT_DETAILS.USER_ID}, + Keys.USERS_PKEY, + new TableField[] {Users.USERS.ID}, + true); + public static final ForeignKey COMP_DATA__COMP_DATA_VO_ID_FKEY = + Internal.createForeignKey( + CompData.COMP_DATA, + DSL.name("comp_data_vo_id_fkey"), + new TableField[] {CompData.COMP_DATA.VO_ID}, + Keys.COMP_VERSION_PKEY, + new TableField[] {CompVersion.COMP_VERSION.VO_ID}, + true); + public static final ForeignKey + COMP_DATA_HISTORY__COMP_DATA_HISTORY_VO_ID_SYS_VERSION_FKEY = Internal.createForeignKey( + CompDataHistory.COMP_DATA_HISTORY, + DSL.name("comp_data_history_vo_id_sys_version_fkey"), + new TableField[] { + CompDataHistory.COMP_DATA_HISTORY.VO_ID, CompDataHistory.COMP_DATA_HISTORY.SYS_VERSION + }, + Keys.COMP_VERSION_HISTORY_PKEY, + new TableField[] { + CompVersionHistory.COMP_VERSION_HISTORY.VO_ID, + CompVersionHistory.COMP_VERSION_HISTORY.SYS_VERSION + }, + true); + public static final ForeignKey COMP_VERSION__COMP_VERSION_AUDIT_ID_FKEY = + Internal.createForeignKey( + CompVersion.COMP_VERSION, + DSL.name("comp_version_audit_id_fkey"), + new TableField[] {CompVersion.COMP_VERSION.AUDIT_ID}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + COMP_VERSION__COMP_VERSION_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + CompVersion.COMP_VERSION, + DSL.name("comp_version_contribution_id_fkey"), + new TableField[] {CompVersion.COMP_VERSION.CONTRIBUTION_ID}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final ForeignKey COMP_VERSION__COMP_VERSION_EHR_ID_FKEY = + Internal.createForeignKey( + CompVersion.COMP_VERSION, + DSL.name("comp_version_ehr_id_fkey"), + new TableField[] {CompVersion.COMP_VERSION.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey COMP_VERSION__COMP_VERSION_TEMPLATE_ID_FKEY = + Internal.createForeignKey( + CompVersion.COMP_VERSION, + DSL.name("comp_version_template_id_fkey"), + new TableField[] {CompVersion.COMP_VERSION.TEMPLATE_ID}, + Keys.TEMPLATE_STORE_PKEY, + new TableField[] {TemplateStore.TEMPLATE_STORE.ID}, + true); + public static final ForeignKey + COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_AUDIT_ID_FKEY = Internal.createForeignKey( + CompVersionHistory.COMP_VERSION_HISTORY, + DSL.name("comp_version_history_audit_id_fkey"), + new TableField[] {CompVersionHistory.COMP_VERSION_HISTORY.AUDIT_ID}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + CompVersionHistory.COMP_VERSION_HISTORY, + DSL.name("comp_version_history_contribution_id_fkey"), + new TableField[] {CompVersionHistory.COMP_VERSION_HISTORY.CONTRIBUTION_ID}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final ForeignKey + COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_EHR_ID_FKEY = Internal.createForeignKey( + CompVersionHistory.COMP_VERSION_HISTORY, + DSL.name("comp_version_history_ehr_id_fkey"), + new TableField[] {CompVersionHistory.COMP_VERSION_HISTORY.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_TEMPLATE_ID_FKEY = Internal.createForeignKey( + CompVersionHistory.COMP_VERSION_HISTORY, + DSL.name("comp_version_history_template_id_fkey"), + new TableField[] {CompVersionHistory.COMP_VERSION_HISTORY.TEMPLATE_ID}, + Keys.TEMPLATE_STORE_PKEY, + new TableField[] {TemplateStore.TEMPLATE_STORE.ID}, + true); + public static final ForeignKey CONTRIBUTION__CONTRIBUTION_EHR_ID_FKEY = + Internal.createForeignKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_ehr_id_fkey"), + new TableField[] {Contribution.CONTRIBUTION.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey CONTRIBUTION__CONTRIBUTION_HAS_AUDIT_FKEY = + Internal.createForeignKey( + Contribution.CONTRIBUTION, + DSL.name("contribution_has_audit_fkey"), + new TableField[] {Contribution.CONTRIBUTION.HAS_AUDIT}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + EHR_FOLDER_DATA__EHR_FOLDER_DATA_EHR_ID_EHR_FOLDERS_IDX_FKEY = Internal.createForeignKey( + EhrFolderData.EHR_FOLDER_DATA, + DSL.name("ehr_folder_data_ehr_id_ehr_folders_idx_fkey"), + new TableField[] { + EhrFolderData.EHR_FOLDER_DATA.EHR_ID, EhrFolderData.EHR_FOLDER_DATA.EHR_FOLDERS_IDX + }, + Keys.EHR_FOLDER_VERSION_PKEY, + new TableField[] { + EhrFolderVersion.EHR_FOLDER_VERSION.EHR_ID, EhrFolderVersion.EHR_FOLDER_VERSION.EHR_FOLDERS_IDX + }, + true); + public static final ForeignKey EHR_FOLDER_DATA__EHR_FOLDER_EHR_ID_FKEY = + Internal.createForeignKey( + EhrFolderData.EHR_FOLDER_DATA, + DSL.name("ehr_folder_ehr_id_fkey"), + new TableField[] {EhrFolderData.EHR_FOLDER_DATA.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_FOLDER_DATA_HISTORY__EHR_FOLDER_DATA_HISTORY_EHR_ID_EHR_FOLDERS_IDX_SYS_VERSION_FKEY = + Internal.createForeignKey( + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY, + DSL.name("ehr_folder_data_history_ehr_id_ehr_folders_idx_sys_version_fkey"), + new TableField[] { + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_ID, + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_FOLDERS_IDX, + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.SYS_VERSION + }, + Keys.EHR_FOLDER_VERSION_HISTORY_PKEY, + new TableField[] { + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_ID, + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_FOLDERS_IDX, + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.SYS_VERSION + }, + true); + public static final ForeignKey + EHR_FOLDER_DATA_HISTORY__EHR_FOLDER_HISTORY_EHR_ID_FKEY = Internal.createForeignKey( + EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY, + DSL.name("ehr_folder_history_ehr_id_fkey"), + new TableField[] {EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_AUDIT_ID_FKEY = Internal.createForeignKey( + EhrFolderVersion.EHR_FOLDER_VERSION, + DSL.name("ehr_folder_version_audit_id_fkey"), + new TableField[] {EhrFolderVersion.EHR_FOLDER_VERSION.AUDIT_ID}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + EhrFolderVersion.EHR_FOLDER_VERSION, + DSL.name("ehr_folder_version_contribution_id_fkey"), + new TableField[] {EhrFolderVersion.EHR_FOLDER_VERSION.CONTRIBUTION_ID}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final ForeignKey + EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_EHR_ID_FKEY = Internal.createForeignKey( + EhrFolderVersion.EHR_FOLDER_VERSION, + DSL.name("ehr_folder_version_ehr_id_fkey"), + new TableField[] {EhrFolderVersion.EHR_FOLDER_VERSION.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_AUDIT_ID_FKEY = Internal.createForeignKey( + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY, + DSL.name("ehr_folder_version_history_audit_id_fkey"), + new TableField[] {EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.AUDIT_ID}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY, + DSL.name("ehr_folder_version_history_contribution_id_fkey"), + new TableField[] {EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.CONTRIBUTION_ID}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final ForeignKey + EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_EHR_ID_FKEY = Internal.createForeignKey( + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY, + DSL.name("ehr_folder_version_history_ehr_id_fkey"), + new TableField[] {EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_STATUS_DATA__EHR_STATUS_DATA_EHR_ID_FKEY = Internal.createForeignKey( + EhrStatusData.EHR_STATUS_DATA, + DSL.name("ehr_status_data_ehr_id_fkey"), + new TableField[] {EhrStatusData.EHR_STATUS_DATA.EHR_ID}, + Keys.EHR_STATUS_VERSION_PKEY, + new TableField[] {EhrStatusVersion.EHR_STATUS_VERSION.EHR_ID}, + true); + public static final ForeignKey EHR_STATUS_DATA__EHR_STATUS_EHR_ID_FKEY = + Internal.createForeignKey( + EhrStatusData.EHR_STATUS_DATA, + DSL.name("ehr_status_ehr_id_fkey"), + new TableField[] {EhrStatusData.EHR_STATUS_DATA.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_STATUS_DATA_HISTORY__EHR_STATUS_DATA_HISTORY_EHR_ID_SYS_VERSION_FKEY = Internal.createForeignKey( + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY, + DSL.name("ehr_status_data_history_ehr_id_sys_version_fkey"), + new TableField[] { + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.EHR_ID, + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.SYS_VERSION + }, + Keys.EHR_STATUS_VERSION_HISTORY_PKEY, + new TableField[] { + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.EHR_ID, + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.SYS_VERSION + }, + true); + public static final ForeignKey + EHR_STATUS_DATA_HISTORY__EHR_STATUS_HISTORY_EHR_ID_FKEY = Internal.createForeignKey( + EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY, + DSL.name("ehr_status_history_ehr_id_fkey"), + new TableField[] {EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_STATUS_VERSION__EHR_STATUS_VERSION_AUDIT_ID_FKEY = Internal.createForeignKey( + EhrStatusVersion.EHR_STATUS_VERSION, + DSL.name("ehr_status_version_audit_id_fkey"), + new TableField[] {EhrStatusVersion.EHR_STATUS_VERSION.AUDIT_ID}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + EHR_STATUS_VERSION__EHR_STATUS_VERSION_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + EhrStatusVersion.EHR_STATUS_VERSION, + DSL.name("ehr_status_version_contribution_id_fkey"), + new TableField[] {EhrStatusVersion.EHR_STATUS_VERSION.CONTRIBUTION_ID}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final ForeignKey + EHR_STATUS_VERSION__EHR_STATUS_VERSION_EHR_ID_FKEY = Internal.createForeignKey( + EhrStatusVersion.EHR_STATUS_VERSION, + DSL.name("ehr_status_version_ehr_id_fkey"), + new TableField[] {EhrStatusVersion.EHR_STATUS_VERSION.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); + public static final ForeignKey + EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_AUDIT_ID_FKEY = Internal.createForeignKey( + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY, + DSL.name("ehr_status_version_history_audit_id_fkey"), + new TableField[] {EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.AUDIT_ID}, + Keys.AUDIT_DETAILS_PKEY, + new TableField[] {AuditDetails.AUDIT_DETAILS.ID}, + true); + public static final ForeignKey + EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_CONTRIBUTION_ID_FKEY = Internal.createForeignKey( + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY, + DSL.name("ehr_status_version_history_contribution_id_fkey"), + new TableField[] {EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.CONTRIBUTION_ID}, + Keys.CONTRIBUTION_PKEY, + new TableField[] {Contribution.CONTRIBUTION.ID}, + true); + public static final ForeignKey + EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_EHR_ID_FKEY = Internal.createForeignKey( + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY, + DSL.name("ehr_status_version_history_ehr_id_fkey"), + new TableField[] {EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.EHR_ID}, + Keys.EHR_PKEY, + new TableField[] {Ehr.EHR_.ID}, + true); +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Sequences.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Sequences.java new file mode 100644 index 0000000..89e4e37 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Sequences.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg; + +import org.jooq.Sequence; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +/** + * Convenience access to all sequences in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Sequences { + + /** + * The sequence ehr.tenant_id_seq + */ + public static final Sequence TENANT_ID_SEQ = Internal.createSequence( + "tenant_id_seq", Ehr.EHR, SQLDataType.BIGINT.nullable(false), null, null, null, null, false, null); +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Tables.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Tables.java new file mode 100644 index 0000000..4d11084 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/Tables.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg; + +import org.ehrbase.migration.importer.v4.jooq.pg.tables.AuditDetails; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Contribution; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusData; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusDataHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersion; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersionHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.FlywaySchemaHistory; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Plugin; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.StoredQuery; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.TemplateStore; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Users; + +/** + * Convenience access to all tables in ehr. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Tables { + + /** + * The table ehr.audit_details. + */ + public static final AuditDetails AUDIT_DETAILS = AuditDetails.AUDIT_DETAILS; + + /** + * The table ehr.comp_data. + */ + public static final CompData COMP_DATA = CompData.COMP_DATA; + + /** + * The table ehr.comp_data_history. + */ + public static final CompDataHistory COMP_DATA_HISTORY = CompDataHistory.COMP_DATA_HISTORY; + + /** + * The table ehr.comp_version. + */ + public static final CompVersion COMP_VERSION = CompVersion.COMP_VERSION; + + /** + * The table ehr.comp_version_history. + */ + public static final CompVersionHistory COMP_VERSION_HISTORY = CompVersionHistory.COMP_VERSION_HISTORY; + + /** + * The table ehr.contribution. + */ + public static final Contribution CONTRIBUTION = Contribution.CONTRIBUTION; + + /** + * The table ehr.ehr. + */ + public static final org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr EHR_ = + org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr.EHR_; + + /** + * The table ehr.ehr_folder_data. + */ + public static final EhrFolderData EHR_FOLDER_DATA = EhrFolderData.EHR_FOLDER_DATA; + + /** + * The table ehr.ehr_folder_data_history. + */ + public static final EhrFolderDataHistory EHR_FOLDER_DATA_HISTORY = EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY; + + /** + * The table ehr.ehr_folder_version. + */ + public static final EhrFolderVersion EHR_FOLDER_VERSION = EhrFolderVersion.EHR_FOLDER_VERSION; + + /** + * The table ehr.ehr_folder_version_history. + */ + public static final EhrFolderVersionHistory EHR_FOLDER_VERSION_HISTORY = + EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY; + + /** + * The table ehr.ehr_status_data. + */ + public static final EhrStatusData EHR_STATUS_DATA = EhrStatusData.EHR_STATUS_DATA; + + /** + * The table ehr.ehr_status_data_history. + */ + public static final EhrStatusDataHistory EHR_STATUS_DATA_HISTORY = EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY; + + /** + * The table ehr.ehr_status_version. + */ + public static final EhrStatusVersion EHR_STATUS_VERSION = EhrStatusVersion.EHR_STATUS_VERSION; + + /** + * The table ehr.ehr_status_version_history. + */ + public static final EhrStatusVersionHistory EHR_STATUS_VERSION_HISTORY = + EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY; + + /** + * The table ehr.flyway_schema_history. + */ + public static final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY; + + /** + * key value store for plugin sub system + */ + public static final Plugin PLUGIN = Plugin.PLUGIN; + + /** + * The table ehr.stored_query. + */ + public static final StoredQuery STORED_QUERY = StoredQuery.STORED_QUERY; + + /** + * The table ehr.template_store. + */ + public static final TemplateStore TEMPLATE_STORE = TemplateStore.TEMPLATE_STORE; + + /** + * The table ehr.users. + */ + public static final Users USERS = Users.USERS; +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionChangeType.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionChangeType.java new file mode 100644 index 0000000..9f58b63 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionChangeType.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.enums; + +import org.ehrbase.migration.importer.v4.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public enum ContributionChangeType implements EnumType { + creation("creation"), + + amendment("amendment"), + + modification("modification"), + + synthesis("synthesis"), + + Unknown("Unknown"), + + deleted("deleted"); + + private final String literal; + + private ContributionChangeType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "contribution_change_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static ContributionChangeType lookupLiteral(String literal) { + return EnumType.lookupLiteral(ContributionChangeType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionDataType.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionDataType.java new file mode 100644 index 0000000..1db8438 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionDataType.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.enums; + +import org.ehrbase.migration.importer.v4.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public enum ContributionDataType implements EnumType { + composition("composition"), + + folder("folder"), + + ehr("ehr"), + + system("system"), + + other("other"); + + private final String literal; + + private ContributionDataType(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "contribution_data_type"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static ContributionDataType lookupLiteral(String literal) { + return EnumType.lookupLiteral(ContributionDataType.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionState.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionState.java new file mode 100644 index 0000000..9851402 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/enums/ContributionState.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.enums; + +import org.ehrbase.migration.importer.v4.jooq.pg.Ehr; +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public enum ContributionState implements EnumType { + complete("complete"), + + incomplete("incomplete"), + + deleted("deleted"); + + private final String literal; + + private ContributionState(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return Ehr.EHR; + } + + @Override + public String getName() { + return "contribution_state"; + } + + @Override + public String getLiteral() { + return literal; + } + + /** + * Lookup a value of this EnumType by its literal + */ + public static ContributionState lookupLiteral(String literal) { + return EnumType.lookupLiteral(ContributionState.class, literal); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/AuditDetails.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/AuditDetails.java new file mode 100644 index 0000000..3a9ab77 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/AuditDetails.java @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Ehr; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionChangeType; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.AuditDetailsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function7; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row7; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class AuditDetails extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.audit_details + */ + public static final AuditDetails AUDIT_DETAILS = new AuditDetails(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AuditDetailsRecord.class; + } + + /** + * The column ehr.audit_details.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.audit_details.change_type. + */ + public final TableField CHANGE_TYPE = createField( + DSL.name("change_type"), + SQLDataType.VARCHAR + .nullable(false) + .asEnumDataType(org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionChangeType.class), + this, + ""); + + /** + * The column ehr.audit_details.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.audit_details.time_committed. + */ + public final TableField TIME_COMMITTED = createField( + DSL.name("time_committed"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.audit_details.committer. + */ + public final TableField COMMITTER = + createField(DSL.name("committer"), SQLDataType.JSONB, this, ""); + + /** + * The column ehr.audit_details.user_id. + */ + public final TableField USER_ID = + createField(DSL.name("user_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.audit_details.target_type. + */ + public final TableField TARGET_TYPE = + createField(DSL.name("target_type"), SQLDataType.VARCHAR.nullable(false), this, ""); + + private AuditDetails(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AuditDetails(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.audit_details table reference + */ + public AuditDetails(String alias) { + this(DSL.name(alias), AUDIT_DETAILS); + } + + /** + * Create an aliased ehr.audit_details table reference + */ + public AuditDetails(Name alias) { + this(alias, AUDIT_DETAILS); + } + + /** + * Create a ehr.audit_details table reference + */ + public AuditDetails() { + this(DSL.name("audit_details"), null); + } + + public AuditDetails(Table child, ForeignKey key) { + super(child, key, AUDIT_DETAILS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.AUDIT_DETAILS_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.AUDIT_DETAILS__AUDIT_DETAILS_USER_ID_FKEY); + } + + private transient Users _users; + + /** + * Get the implicit join path to the ehr.users table. + */ + public Users users() { + if (_users == null) _users = new Users(this, Keys.AUDIT_DETAILS__AUDIT_DETAILS_USER_ID_FKEY); + + return _users; + } + + @Override + public AuditDetails as(String alias) { + return new AuditDetails(DSL.name(alias), this); + } + + @Override + public AuditDetails as(Name alias) { + return new AuditDetails(alias, this); + } + + @Override + public AuditDetails as(Table alias) { + return new AuditDetails(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AuditDetails rename(String name) { + return new AuditDetails(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AuditDetails rename(Name name) { + return new AuditDetails(name, null); + } + + /** + * Rename this table + */ + @Override + public AuditDetails rename(Table name) { + return new AuditDetails(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function7< + ? super UUID, + ? super ContributionChangeType, + ? super String, + ? super OffsetDateTime, + ? super JSONB, + ? super UUID, + ? super String, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function7< + ? super UUID, + ? super ContributionChangeType, + ? super String, + ? super OffsetDateTime, + ? super JSONB, + ? super UUID, + ? super String, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompData.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompData.java new file mode 100644 index 0000000..39f750d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompData.java @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompDataRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function13; +import org.jooq.Index; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row13; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompData extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.comp_data + */ + public static final CompData COMP_DATA = new CompData(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompDataRecord.class; + } + + /** + * The column ehr.comp_data.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_data.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.comp_data.citem_num. + */ + public final TableField CITEM_NUM = + createField(DSL.name("citem_num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.comp_data.rm_entity. + */ + public final TableField RM_ENTITY = + createField(DSL.name("rm_entity"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data.entity_concept. + */ + public final TableField ENTITY_CONCEPT = + createField(DSL.name("entity_concept"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_data.entity_name. + */ + public final TableField ENTITY_NAME = + createField(DSL.name("entity_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_data.entity_attribute. + */ + public final TableField ENTITY_ATTRIBUTE = + createField(DSL.name("entity_attribute"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_data.entity_path. + */ + public final TableField ENTITY_PATH = + createField(DSL.name("entity_path"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data.entity_path_cap. + */ + public final TableField ENTITY_PATH_CAP = + createField(DSL.name("entity_path_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data.entity_idx. + */ + public final TableField ENTITY_IDX = + createField(DSL.name("entity_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data.entity_idx_cap. + */ + public final TableField ENTITY_IDX_CAP = + createField(DSL.name("entity_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data.entity_idx_len. + */ + public final TableField ENTITY_IDX_LEN = + createField(DSL.name("entity_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.comp_data.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.JSONB.nullable(false), this, ""); + + private CompData(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompData(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.comp_data table reference + */ + public CompData(String alias) { + this(DSL.name(alias), COMP_DATA); + } + + /** + * Create an aliased ehr.comp_data table reference + */ + public CompData(Name alias) { + this(alias, COMP_DATA); + } + + /** + * Create a ehr.comp_data table reference + */ + public CompData() { + this(DSL.name("comp_data"), null); + } + + public CompData(Table child, ForeignKey key) { + super(child, key, COMP_DATA); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.COMP_DATA_LEAF_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.COMP_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.COMP_DATA__COMP_DATA_VO_ID_FKEY); + } + + private transient CompVersion _compVersion; + + /** + * Get the implicit join path to the ehr.comp_version table. + */ + public CompVersion compVersion() { + if (_compVersion == null) _compVersion = new CompVersion(this, Keys.COMP_DATA__COMP_DATA_VO_ID_FKEY); + + return _compVersion; + } + + @Override + public CompData as(String alias) { + return new CompData(DSL.name(alias), this); + } + + @Override + public CompData as(Name alias) { + return new CompData(alias, this); + } + + @Override + public CompData as(Table alias) { + return new CompData(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompData rename(String name) { + return new CompData(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompData rename(Name name) { + return new CompData(name, null); + } + + /** + * Rename this table + */ + @Override + public CompData rename(Table name) { + return new CompData(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row13 type methods + // ------------------------------------------------------------------------- + + @Override + public Row13 + fieldsRow() { + return (Row13) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function13< + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function13< + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompDataHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompDataHistory.java new file mode 100644 index 0000000..6e06ed2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompDataHistory.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompDataHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function14; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row14; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompDataHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.comp_data_history + */ + public static final CompDataHistory COMP_DATA_HISTORY = new CompDataHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompDataHistoryRecord.class; + } + + /** + * The column ehr.comp_data_history.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.citem_num. + */ + public final TableField CITEM_NUM = + createField(DSL.name("citem_num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.comp_data_history.rm_entity. + */ + public final TableField RM_ENTITY = + createField(DSL.name("rm_entity"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.entity_concept. + */ + public final TableField ENTITY_CONCEPT = + createField(DSL.name("entity_concept"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_data_history.entity_name. + */ + public final TableField ENTITY_NAME = + createField(DSL.name("entity_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_data_history.entity_attribute. + */ + public final TableField ENTITY_ATTRIBUTE = + createField(DSL.name("entity_attribute"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.comp_data_history.entity_path. + */ + public final TableField ENTITY_PATH = + createField(DSL.name("entity_path"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.entity_path_cap. + */ + public final TableField ENTITY_PATH_CAP = + createField(DSL.name("entity_path_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.entity_idx. + */ + public final TableField ENTITY_IDX = + createField(DSL.name("entity_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.entity_idx_cap. + */ + public final TableField ENTITY_IDX_CAP = + createField(DSL.name("entity_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.entity_idx_len. + */ + public final TableField ENTITY_IDX_LEN = + createField(DSL.name("entity_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.JSONB.nullable(false), this, ""); + + /** + * The column ehr.comp_data_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + private CompDataHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompDataHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.comp_data_history table reference + */ + public CompDataHistory(String alias) { + this(DSL.name(alias), COMP_DATA_HISTORY); + } + + /** + * Create an aliased ehr.comp_data_history table reference + */ + public CompDataHistory(Name alias) { + this(alias, COMP_DATA_HISTORY); + } + + /** + * Create a ehr.comp_data_history table reference + */ + public CompDataHistory() { + this(DSL.name("comp_data_history"), null); + } + + public CompDataHistory(Table child, ForeignKey key) { + super(child, key, COMP_DATA_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.COMP_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.COMP_DATA_HISTORY__COMP_DATA_HISTORY_VO_ID_SYS_VERSION_FKEY); + } + + private transient CompVersionHistory _compVersionHistory; + + /** + * Get the implicit join path to the ehr.comp_version_history + * table. + */ + public CompVersionHistory compVersionHistory() { + if (_compVersionHistory == null) + _compVersionHistory = + new CompVersionHistory(this, Keys.COMP_DATA_HISTORY__COMP_DATA_HISTORY_VO_ID_SYS_VERSION_FKEY); + + return _compVersionHistory; + } + + @Override + public CompDataHistory as(String alias) { + return new CompDataHistory(DSL.name(alias), this); + } + + @Override + public CompDataHistory as(Name alias) { + return new CompDataHistory(alias, this); + } + + @Override + public CompDataHistory as(Table alias) { + return new CompDataHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompDataHistory rename(String name) { + return new CompDataHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompDataHistory rename(Name name) { + return new CompDataHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public CompDataHistory rename(Table name) { + return new CompDataHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row14 type methods + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function14< + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? super Integer, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function14< + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? super Integer, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersion.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersion.java new file mode 100644 index 0000000..8fb9d65 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersion.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompVersionRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function8; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row8; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompVersion extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.comp_version + */ + public static final CompVersion COMP_VERSION = new CompVersion(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompVersionRecord.class; + } + + /** + * The column ehr.comp_version.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.comp_version.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.comp_version.root_concept. + */ + public final TableField ROOT_CONCEPT = + createField(DSL.name("root_concept"), SQLDataType.CLOB.nullable(false), this, ""); + + private CompVersion(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompVersion(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.comp_version table reference + */ + public CompVersion(String alias) { + this(DSL.name(alias), COMP_VERSION); + } + + /** + * Create an aliased ehr.comp_version table reference + */ + public CompVersion(Name alias) { + this(alias, COMP_VERSION); + } + + /** + * Create a ehr.comp_version table reference + */ + public CompVersion() { + this(DSL.name("comp_version"), null); + } + + public CompVersion(Table child, ForeignKey key) { + super(child, key, COMP_VERSION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.COMP_VERSION_SYS_PERIOD_LOWER_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.COMP_VERSION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.COMP_VERSION__COMP_VERSION_EHR_ID_FKEY, + Keys.COMP_VERSION__COMP_VERSION_CONTRIBUTION_ID_FKEY, + Keys.COMP_VERSION__COMP_VERSION_AUDIT_ID_FKEY, + Keys.COMP_VERSION__COMP_VERSION_TEMPLATE_ID_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + private transient TemplateStore _templateStore; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.COMP_VERSION__COMP_VERSION_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution(this, Keys.COMP_VERSION__COMP_VERSION_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.COMP_VERSION__COMP_VERSION_AUDIT_ID_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.template_store table. + */ + public TemplateStore templateStore() { + if (_templateStore == null) + _templateStore = new TemplateStore(this, Keys.COMP_VERSION__COMP_VERSION_TEMPLATE_ID_FKEY); + + return _templateStore; + } + + @Override + public CompVersion as(String alias) { + return new CompVersion(DSL.name(alias), this); + } + + @Override + public CompVersion as(Name alias) { + return new CompVersion(alias, this); + } + + @Override + public CompVersion as(Table alias) { + return new CompVersion(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompVersion rename(String name) { + return new CompVersion(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompVersion rename(Name name) { + return new CompVersion(name, null); + } + + /** + * Rename this table + */ + @Override + public CompVersion rename(Table name) { + return new CompVersion(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function8< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super String, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function8< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super String, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersionHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersionHistory.java new file mode 100644 index 0000000..ced64d8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/CompVersionHistory.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.CompVersionHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function10; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row10; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompVersionHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.comp_version_history + */ + public static final CompVersionHistory COMP_VERSION_HISTORY = new CompVersionHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CompVersionHistoryRecord.class; + } + + /** + * The column ehr.comp_version_history.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.sys_period_upper. + */ + public final TableField SYS_PERIOD_UPPER = + createField(DSL.name("sys_period_upper"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); + + /** + * The column ehr.comp_version_history.sys_deleted. + */ + public final TableField SYS_DELETED = + createField(DSL.name("sys_deleted"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * The column ehr.comp_version_history.root_concept. + */ + public final TableField ROOT_CONCEPT = + createField(DSL.name("root_concept"), SQLDataType.CLOB, this, ""); + + private CompVersionHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CompVersionHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.comp_version_history table reference + */ + public CompVersionHistory(String alias) { + this(DSL.name(alias), COMP_VERSION_HISTORY); + } + + /** + * Create an aliased ehr.comp_version_history table reference + */ + public CompVersionHistory(Name alias) { + this(alias, COMP_VERSION_HISTORY); + } + + /** + * Create a ehr.comp_version_history table reference + */ + public CompVersionHistory() { + this(DSL.name("comp_version_history"), null); + } + + public CompVersionHistory(Table child, ForeignKey key) { + super(child, key, COMP_VERSION_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.COMP_VERSION_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_EHR_ID_FKEY, + Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_CONTRIBUTION_ID_FKEY, + Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_AUDIT_ID_FKEY, + Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_TEMPLATE_ID_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + private transient TemplateStore _templateStore; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = + new Contribution(this, Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_AUDIT_ID_FKEY); + + return _auditDetails; + } + + /** + * Get the implicit join path to the ehr.template_store table. + */ + public TemplateStore templateStore() { + if (_templateStore == null) + _templateStore = new TemplateStore(this, Keys.COMP_VERSION_HISTORY__COMP_VERSION_HISTORY_TEMPLATE_ID_FKEY); + + return _templateStore; + } + + @Override + public CompVersionHistory as(String alias) { + return new CompVersionHistory(DSL.name(alias), this); + } + + @Override + public CompVersionHistory as(Name alias) { + return new CompVersionHistory(alias, this); + } + + @Override + public CompVersionHistory as(Table alias) { + return new CompVersionHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CompVersionHistory rename(String name) { + return new CompVersionHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CompVersionHistory rename(Name name) { + return new CompVersionHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public CompVersionHistory rename(Table name) { + return new CompVersionHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row10 type methods + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function10< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super OffsetDateTime, + ? super Boolean, + ? super String, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function10< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super OffsetDateTime, + ? super Boolean, + ? super String, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Contribution.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Contribution.java new file mode 100644 index 0000000..f7d0309 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Contribution.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionDataType; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.ContributionRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function5; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Contribution extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.contribution + */ + public static final Contribution CONTRIBUTION = new Contribution(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ContributionRecord.class; + } + + /** + * The column ehr.contribution.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.contribution.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID, this, ""); + + /** + * The column ehr.contribution.contribution_type. + */ + public final TableField CONTRIBUTION_TYPE = createField( + DSL.name("contribution_type"), + SQLDataType.VARCHAR.asEnumDataType( + org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionDataType.class), + this, + ""); + + /** + * The column ehr.contribution.signature. + */ + public final TableField SIGNATURE = + createField(DSL.name("signature"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.contribution.has_audit. + */ + public final TableField HAS_AUDIT = + createField(DSL.name("has_audit"), SQLDataType.UUID, this, ""); + + private Contribution(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Contribution(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.contribution table reference + */ + public Contribution(String alias) { + this(DSL.name(alias), CONTRIBUTION); + } + + /** + * Create an aliased ehr.contribution table reference + */ + public Contribution(Name alias) { + this(alias, CONTRIBUTION); + } + + /** + * Create a ehr.contribution table reference + */ + public Contribution() { + this(DSL.name("contribution"), null); + } + + public Contribution(Table child, ForeignKey key) { + super(child, key, CONTRIBUTION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CONTRIBUTION_EHR_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONTRIBUTION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.CONTRIBUTION__CONTRIBUTION_EHR_ID_FKEY, Keys.CONTRIBUTION__CONTRIBUTION_HAS_AUDIT_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient AuditDetails _auditDetails; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.CONTRIBUTION__CONTRIBUTION_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.CONTRIBUTION__CONTRIBUTION_HAS_AUDIT_FKEY); + + return _auditDetails; + } + + @Override + public Contribution as(String alias) { + return new Contribution(DSL.name(alias), this); + } + + @Override + public Contribution as(Name alias) { + return new Contribution(alias, this); + } + + @Override + public Contribution as(Table alias) { + return new Contribution(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Contribution rename(String name) { + return new Contribution(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Contribution rename(Name name) { + return new Contribution(name, null); + } + + /** + * Rename this table + */ + @Override + public Contribution rename(Table name) { + return new Contribution(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function5< + ? super UUID, + ? super UUID, + ? super ContributionDataType, + ? super String, + ? super UUID, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function5< + ? super UUID, + ? super UUID, + ? super ContributionDataType, + ? super String, + ? super UUID, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Ehr.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Ehr.java new file mode 100644 index 0000000..2da15c1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Ehr.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Ehr extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr + */ + public static final Ehr EHR_ = new Ehr(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrRecord.class; + } + + /** + * The column ehr.ehr.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr.creation_date. + */ + public final TableField CREATION_DATE = + createField(DSL.name("creation_date"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); + + private Ehr(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Ehr(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr table reference + */ + public Ehr(String alias) { + this(DSL.name(alias), EHR_); + } + + /** + * Create an aliased ehr.ehr table reference + */ + public Ehr(Name alias) { + this(alias, EHR_); + } + + /** + * Create a ehr.ehr table reference + */ + public Ehr() { + this(DSL.name("ehr"), null); + } + + public Ehr(Table child, ForeignKey key) { + super(child, key, EHR_); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_PKEY; + } + + @Override + public Ehr as(String alias) { + return new Ehr(DSL.name(alias), this); + } + + @Override + public Ehr as(Name alias) { + return new Ehr(alias, this); + } + + @Override + public Ehr as(Table alias) { + return new Ehr(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Ehr rename(String name) { + return new Ehr(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Ehr rename(Name name) { + return new Ehr(name, null); + } + + /** + * Rename this table + */ + @Override + public Ehr rename(Table name) { + return new Ehr(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderData.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderData.java new file mode 100644 index 0000000..7acf4ac --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderData.java @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderDataRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function15; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row15; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderData extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_folder_data + */ + public static final EhrFolderData EHR_FOLDER_DATA = new EhrFolderData(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrFolderDataRecord.class; + } + + /** + * The column ehr.ehr_folder_data.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.ehr_folders_idx. + */ + public final TableField EHR_FOLDERS_IDX = + createField(DSL.name("ehr_folders_idx"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.citem_num. + */ + public final TableField CITEM_NUM = + createField(DSL.name("citem_num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.ehr_folder_data.rm_entity. + */ + public final TableField RM_ENTITY = + createField(DSL.name("rm_entity"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.entity_concept. + */ + public final TableField ENTITY_CONCEPT = + createField(DSL.name("entity_concept"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_data.entity_name. + */ + public final TableField ENTITY_NAME = + createField(DSL.name("entity_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_data.entity_attribute. + */ + public final TableField ENTITY_ATTRIBUTE = + createField(DSL.name("entity_attribute"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_data.entity_path. + */ + public final TableField ENTITY_PATH = + createField(DSL.name("entity_path"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.entity_path_cap. + */ + public final TableField ENTITY_PATH_CAP = + createField(DSL.name("entity_path_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.entity_idx. + */ + public final TableField ENTITY_IDX = + createField(DSL.name("entity_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.entity_idx_cap. + */ + public final TableField ENTITY_IDX_CAP = + createField(DSL.name("entity_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.entity_idx_len. + */ + public final TableField ENTITY_IDX_LEN = + createField(DSL.name("entity_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.JSONB.nullable(false), this, ""); + + private EhrFolderData(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrFolderData(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_folder_data table reference + */ + public EhrFolderData(String alias) { + this(DSL.name(alias), EHR_FOLDER_DATA); + } + + /** + * Create an aliased ehr.ehr_folder_data table reference + */ + public EhrFolderData(Name alias) { + this(alias, EHR_FOLDER_DATA); + } + + /** + * Create a ehr.ehr_folder_data table reference + */ + public EhrFolderData() { + this(DSL.name("ehr_folder_data"), null); + } + + public EhrFolderData(Table child, ForeignKey key) { + super(child, key, EHR_FOLDER_DATA); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_FOLDER_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_FOLDER_DATA__EHR_FOLDER_DATA_EHR_ID_EHR_FOLDERS_IDX_FKEY, + Keys.EHR_FOLDER_DATA__EHR_FOLDER_EHR_ID_FKEY); + } + + private transient EhrFolderVersion _ehrFolderVersion; + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + + /** + * Get the implicit join path to the ehr.ehr_folder_version + * table. + */ + public EhrFolderVersion ehrFolderVersion() { + if (_ehrFolderVersion == null) + _ehrFolderVersion = + new EhrFolderVersion(this, Keys.EHR_FOLDER_DATA__EHR_FOLDER_DATA_EHR_ID_EHR_FOLDERS_IDX_FKEY); + + return _ehrFolderVersion; + } + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_FOLDER_DATA__EHR_FOLDER_EHR_ID_FKEY); + + return _ehr; + } + + @Override + public EhrFolderData as(String alias) { + return new EhrFolderData(DSL.name(alias), this); + } + + @Override + public EhrFolderData as(Name alias) { + return new EhrFolderData(alias, this); + } + + @Override + public EhrFolderData as(Table alias) { + return new EhrFolderData(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrFolderData rename(String name) { + return new EhrFolderData(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderData rename(Name name) { + return new EhrFolderData(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderData rename(Table name) { + return new EhrFolderData(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function15< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function15< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderDataHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderDataHistory.java new file mode 100644 index 0000000..fd68763 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderDataHistory.java @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderDataHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function16; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row16; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderDataHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_folder_data_history + */ + public static final EhrFolderDataHistory EHR_FOLDER_DATA_HISTORY = new EhrFolderDataHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrFolderDataHistoryRecord.class; + } + + /** + * The column ehr.ehr_folder_data_history.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.ehr_folders_idx. + */ + public final TableField EHR_FOLDERS_IDX = + createField(DSL.name("ehr_folders_idx"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.citem_num. + */ + public final TableField CITEM_NUM = + createField(DSL.name("citem_num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.ehr_folder_data_history.rm_entity. + */ + public final TableField RM_ENTITY = + createField(DSL.name("rm_entity"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_concept. + */ + public final TableField ENTITY_CONCEPT = + createField(DSL.name("entity_concept"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_name. + */ + public final TableField ENTITY_NAME = + createField(DSL.name("entity_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_attribute. + */ + public final TableField ENTITY_ATTRIBUTE = + createField(DSL.name("entity_attribute"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_path. + */ + public final TableField ENTITY_PATH = + createField(DSL.name("entity_path"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_path_cap. + */ + public final TableField ENTITY_PATH_CAP = + createField(DSL.name("entity_path_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_idx. + */ + public final TableField ENTITY_IDX = + createField(DSL.name("entity_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_idx_cap. + */ + public final TableField ENTITY_IDX_CAP = + createField(DSL.name("entity_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.entity_idx_len. + */ + public final TableField ENTITY_IDX_LEN = + createField(DSL.name("entity_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.JSONB.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_data_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + private EhrFolderDataHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrFolderDataHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_folder_data_history table + * reference + */ + public EhrFolderDataHistory(String alias) { + this(DSL.name(alias), EHR_FOLDER_DATA_HISTORY); + } + + /** + * Create an aliased ehr.ehr_folder_data_history table + * reference + */ + public EhrFolderDataHistory(Name alias) { + this(alias, EHR_FOLDER_DATA_HISTORY); + } + + /** + * Create a ehr.ehr_folder_data_history table reference + */ + public EhrFolderDataHistory() { + this(DSL.name("ehr_folder_data_history"), null); + } + + public EhrFolderDataHistory(Table child, ForeignKey key) { + super(child, key, EHR_FOLDER_DATA_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_FOLDER_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_FOLDER_DATA_HISTORY__EHR_FOLDER_DATA_HISTORY_EHR_ID_EHR_FOLDERS_IDX_SYS_VERSION_FKEY, + Keys.EHR_FOLDER_DATA_HISTORY__EHR_FOLDER_HISTORY_EHR_ID_FKEY); + } + + private transient EhrFolderVersionHistory _ehrFolderVersionHistory; + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + + /** + * Get the implicit join path to the + * ehr.ehr_folder_version_history table. + */ + public EhrFolderVersionHistory ehrFolderVersionHistory() { + if (_ehrFolderVersionHistory == null) + _ehrFolderVersionHistory = new EhrFolderVersionHistory( + this, + Keys.EHR_FOLDER_DATA_HISTORY__EHR_FOLDER_DATA_HISTORY_EHR_ID_EHR_FOLDERS_IDX_SYS_VERSION_FKEY); + + return _ehrFolderVersionHistory; + } + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_FOLDER_DATA_HISTORY__EHR_FOLDER_HISTORY_EHR_ID_FKEY); + + return _ehr; + } + + @Override + public EhrFolderDataHistory as(String alias) { + return new EhrFolderDataHistory(DSL.name(alias), this); + } + + @Override + public EhrFolderDataHistory as(Name alias) { + return new EhrFolderDataHistory(alias, this); + } + + @Override + public EhrFolderDataHistory as(Table alias) { + return new EhrFolderDataHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrFolderDataHistory rename(String name) { + return new EhrFolderDataHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderDataHistory rename(Name name) { + return new EhrFolderDataHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderDataHistory rename(Table name) { + return new EhrFolderDataHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row16 type methods + // ------------------------------------------------------------------------- + + @Override + public Row16< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + fieldsRow() { + return (Row16) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function16< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? super Integer, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function16< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? super Integer, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersion.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersion.java new file mode 100644 index 0000000..1a5ad16 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersion.java @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderVersionRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function7; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row7; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderVersion extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_folder_version + */ + public static final EhrFolderVersion EHR_FOLDER_VERSION = new EhrFolderVersion(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrFolderVersionRecord.class; + } + + /** + * The column ehr.ehr_folder_version.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version.ehr_folders_idx. + */ + public final TableField EHR_FOLDERS_IDX = + createField(DSL.name("ehr_folders_idx"), SQLDataType.INTEGER.nullable(false), this, ""); + + private EhrFolderVersion(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrFolderVersion(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_folder_version table reference + */ + public EhrFolderVersion(String alias) { + this(DSL.name(alias), EHR_FOLDER_VERSION); + } + + /** + * Create an aliased ehr.ehr_folder_version table reference + */ + public EhrFolderVersion(Name alias) { + this(alias, EHR_FOLDER_VERSION); + } + + /** + * Create a ehr.ehr_folder_version table reference + */ + public EhrFolderVersion() { + this(DSL.name("ehr_folder_version"), null); + } + + public EhrFolderVersion(Table child, ForeignKey key) { + super(child, key, EHR_FOLDER_VERSION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_FOLDER_VERSION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_EHR_ID_FKEY, + Keys.EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_CONTRIBUTION_ID_FKEY, + Keys.EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_AUDIT_ID_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution(this, Keys.EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.EHR_FOLDER_VERSION__EHR_FOLDER_VERSION_AUDIT_ID_FKEY); + + return _auditDetails; + } + + @Override + public EhrFolderVersion as(String alias) { + return new EhrFolderVersion(DSL.name(alias), this); + } + + @Override + public EhrFolderVersion as(Name alias) { + return new EhrFolderVersion(alias, this); + } + + @Override + public EhrFolderVersion as(Table alias) { + return new EhrFolderVersion(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrFolderVersion rename(String name) { + return new EhrFolderVersion(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderVersion rename(Name name) { + return new EhrFolderVersion(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderVersion rename(Table name) { + return new EhrFolderVersion(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function7< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super Integer, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function7< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super Integer, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersionHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersionHistory.java new file mode 100644 index 0000000..3cb8b99 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrFolderVersionHistory.java @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrFolderVersionHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function9; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row9; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderVersionHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_folder_version_history + */ + public static final EhrFolderVersionHistory EHR_FOLDER_VERSION_HISTORY = new EhrFolderVersionHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrFolderVersionHistoryRecord.class; + } + + /** + * The column ehr.ehr_folder_version_history.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.ehr_folders_idx. + */ + public final TableField EHR_FOLDERS_IDX = + createField(DSL.name("ehr_folders_idx"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_folder_version_history.sys_period_upper. + */ + public final TableField SYS_PERIOD_UPPER = + createField(DSL.name("sys_period_upper"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); + + /** + * The column ehr.ehr_folder_version_history.sys_deleted. + */ + public final TableField SYS_DELETED = + createField(DSL.name("sys_deleted"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + private EhrFolderVersionHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrFolderVersionHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_folder_version_history table + * reference + */ + public EhrFolderVersionHistory(String alias) { + this(DSL.name(alias), EHR_FOLDER_VERSION_HISTORY); + } + + /** + * Create an aliased ehr.ehr_folder_version_history table + * reference + */ + public EhrFolderVersionHistory(Name alias) { + this(alias, EHR_FOLDER_VERSION_HISTORY); + } + + /** + * Create a ehr.ehr_folder_version_history table reference + */ + public EhrFolderVersionHistory() { + this(DSL.name("ehr_folder_version_history"), null); + } + + public EhrFolderVersionHistory( + Table child, ForeignKey key) { + super(child, key, EHR_FOLDER_VERSION_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_FOLDER_VERSION_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_EHR_ID_FKEY, + Keys.EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_CONTRIBUTION_ID_FKEY, + Keys.EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_AUDIT_ID_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution( + this, Keys.EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = + new AuditDetails(this, Keys.EHR_FOLDER_VERSION_HISTORY__EHR_FOLDER_VERSION_HISTORY_AUDIT_ID_FKEY); + + return _auditDetails; + } + + @Override + public EhrFolderVersionHistory as(String alias) { + return new EhrFolderVersionHistory(DSL.name(alias), this); + } + + @Override + public EhrFolderVersionHistory as(Name alias) { + return new EhrFolderVersionHistory(alias, this); + } + + @Override + public EhrFolderVersionHistory as(Table alias) { + return new EhrFolderVersionHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrFolderVersionHistory rename(String name) { + return new EhrFolderVersionHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderVersionHistory rename(Name name) { + return new EhrFolderVersionHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrFolderVersionHistory rename(Table name) { + return new EhrFolderVersionHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function9< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super Integer, + ? super OffsetDateTime, + ? super Boolean, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function9< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super Integer, + ? super OffsetDateTime, + ? super Boolean, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusData.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusData.java new file mode 100644 index 0000000..16ca942 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusData.java @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusDataRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function14; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row14; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusData extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_status_data + */ + public static final EhrStatusData EHR_STATUS_DATA = new EhrStatusData(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrStatusDataRecord.class; + } + + /** + * The column ehr.ehr_status_data.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.citem_num. + */ + public final TableField CITEM_NUM = + createField(DSL.name("citem_num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.ehr_status_data.rm_entity. + */ + public final TableField RM_ENTITY = + createField(DSL.name("rm_entity"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.entity_concept. + */ + public final TableField ENTITY_CONCEPT = + createField(DSL.name("entity_concept"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status_data.entity_name. + */ + public final TableField ENTITY_NAME = + createField(DSL.name("entity_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status_data.entity_attribute. + */ + public final TableField ENTITY_ATTRIBUTE = + createField(DSL.name("entity_attribute"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status_data.entity_path. + */ + public final TableField ENTITY_PATH = + createField(DSL.name("entity_path"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.entity_path_cap. + */ + public final TableField ENTITY_PATH_CAP = + createField(DSL.name("entity_path_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.entity_idx. + */ + public final TableField ENTITY_IDX = + createField(DSL.name("entity_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.entity_idx_cap. + */ + public final TableField ENTITY_IDX_CAP = + createField(DSL.name("entity_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.entity_idx_len. + */ + public final TableField ENTITY_IDX_LEN = + createField(DSL.name("entity_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.JSONB.nullable(false), this, ""); + + private EhrStatusData(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrStatusData(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_status_data table reference + */ + public EhrStatusData(String alias) { + this(DSL.name(alias), EHR_STATUS_DATA); + } + + /** + * Create an aliased ehr.ehr_status_data table reference + */ + public EhrStatusData(Name alias) { + this(alias, EHR_STATUS_DATA); + } + + /** + * Create a ehr.ehr_status_data table reference + */ + public EhrStatusData() { + this(DSL.name("ehr_status_data"), null); + } + + public EhrStatusData(Table child, ForeignKey key) { + super(child, key, EHR_STATUS_DATA); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_STATUS_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_STATUS_DATA__EHR_STATUS_DATA_EHR_ID_FKEY, Keys.EHR_STATUS_DATA__EHR_STATUS_EHR_ID_FKEY); + } + + private transient EhrStatusVersion _ehrStatusVersion; + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + + /** + * Get the implicit join path to the ehr.ehr_status_version + * table. + */ + public EhrStatusVersion ehrStatusVersion() { + if (_ehrStatusVersion == null) + _ehrStatusVersion = new EhrStatusVersion(this, Keys.EHR_STATUS_DATA__EHR_STATUS_DATA_EHR_ID_FKEY); + + return _ehrStatusVersion; + } + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_STATUS_DATA__EHR_STATUS_EHR_ID_FKEY); + + return _ehr; + } + + @Override + public EhrStatusData as(String alias) { + return new EhrStatusData(DSL.name(alias), this); + } + + @Override + public EhrStatusData as(Name alias) { + return new EhrStatusData(alias, this); + } + + @Override + public EhrStatusData as(Table alias) { + return new EhrStatusData(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrStatusData rename(String name) { + return new EhrStatusData(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusData rename(Name name) { + return new EhrStatusData(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusData rename(Table name) { + return new EhrStatusData(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row14 type methods + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function14< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function14< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusDataHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusDataHistory.java new file mode 100644 index 0000000..4be2596 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusDataHistory.java @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusDataHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function15; +import org.jooq.JSONB; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row15; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusDataHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_status_data_history + */ + public static final EhrStatusDataHistory EHR_STATUS_DATA_HISTORY = new EhrStatusDataHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrStatusDataHistoryRecord.class; + } + + /** + * The column ehr.ehr_status_data_history.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.num. + */ + public final TableField NUM = + createField(DSL.name("num"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.citem_num. + */ + public final TableField CITEM_NUM = + createField(DSL.name("citem_num"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.ehr_status_data_history.rm_entity. + */ + public final TableField RM_ENTITY = + createField(DSL.name("rm_entity"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_concept. + */ + public final TableField ENTITY_CONCEPT = + createField(DSL.name("entity_concept"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_name. + */ + public final TableField ENTITY_NAME = + createField(DSL.name("entity_name"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_attribute. + */ + public final TableField ENTITY_ATTRIBUTE = + createField(DSL.name("entity_attribute"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_path. + */ + public final TableField ENTITY_PATH = + createField(DSL.name("entity_path"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_path_cap. + */ + public final TableField ENTITY_PATH_CAP = + createField(DSL.name("entity_path_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_idx. + */ + public final TableField ENTITY_IDX = + createField(DSL.name("entity_idx"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_idx_cap. + */ + public final TableField ENTITY_IDX_CAP = + createField(DSL.name("entity_idx_cap"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.entity_idx_len. + */ + public final TableField ENTITY_IDX_LEN = + createField(DSL.name("entity_idx_len"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.data. + */ + public final TableField DATA = + createField(DSL.name("data"), SQLDataType.JSONB.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_data_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + private EhrStatusDataHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrStatusDataHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_status_data_history table + * reference + */ + public EhrStatusDataHistory(String alias) { + this(DSL.name(alias), EHR_STATUS_DATA_HISTORY); + } + + /** + * Create an aliased ehr.ehr_status_data_history table + * reference + */ + public EhrStatusDataHistory(Name alias) { + this(alias, EHR_STATUS_DATA_HISTORY); + } + + /** + * Create a ehr.ehr_status_data_history table reference + */ + public EhrStatusDataHistory() { + this(DSL.name("ehr_status_data_history"), null); + } + + public EhrStatusDataHistory(Table child, ForeignKey key) { + super(child, key, EHR_STATUS_DATA_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_STATUS_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_STATUS_DATA_HISTORY__EHR_STATUS_DATA_HISTORY_EHR_ID_SYS_VERSION_FKEY, + Keys.EHR_STATUS_DATA_HISTORY__EHR_STATUS_HISTORY_EHR_ID_FKEY); + } + + private transient EhrStatusVersionHistory _ehrStatusVersionHistory; + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + + /** + * Get the implicit join path to the + * ehr.ehr_status_version_history table. + */ + public EhrStatusVersionHistory ehrStatusVersionHistory() { + if (_ehrStatusVersionHistory == null) + _ehrStatusVersionHistory = new EhrStatusVersionHistory( + this, Keys.EHR_STATUS_DATA_HISTORY__EHR_STATUS_DATA_HISTORY_EHR_ID_SYS_VERSION_FKEY); + + return _ehrStatusVersionHistory; + } + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_STATUS_DATA_HISTORY__EHR_STATUS_HISTORY_EHR_ID_FKEY); + + return _ehr; + } + + @Override + public EhrStatusDataHistory as(String alias) { + return new EhrStatusDataHistory(DSL.name(alias), this); + } + + @Override + public EhrStatusDataHistory as(Name alias) { + return new EhrStatusDataHistory(alias, this); + } + + @Override + public EhrStatusDataHistory as(Table alias) { + return new EhrStatusDataHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrStatusDataHistory rename(String name) { + return new EhrStatusDataHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusDataHistory rename(Name name) { + return new EhrStatusDataHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusDataHistory rename(Table name) { + return new EhrStatusDataHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function15< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? super Integer, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function15< + ? super UUID, + ? super Integer, + ? super UUID, + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super JSONB, + ? super Integer, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersion.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersion.java new file mode 100644 index 0000000..09d5eac --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersion.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusVersionRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function6; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusVersion extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_status_version + */ + public static final EhrStatusVersion EHR_STATUS_VERSION = new EhrStatusVersion(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrStatusVersionRecord.class; + } + + /** + * The column ehr.ehr_status_version.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private EhrStatusVersion(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrStatusVersion(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_status_version table reference + */ + public EhrStatusVersion(String alias) { + this(DSL.name(alias), EHR_STATUS_VERSION); + } + + /** + * Create an aliased ehr.ehr_status_version table reference + */ + public EhrStatusVersion(Name alias) { + this(alias, EHR_STATUS_VERSION); + } + + /** + * Create a ehr.ehr_status_version table reference + */ + public EhrStatusVersion() { + this(DSL.name("ehr_status_version"), null); + } + + public EhrStatusVersion(Table child, ForeignKey key) { + super(child, key, EHR_STATUS_VERSION); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.EHR_STATUS_VERSION_SYS_PERIOD_LOWER_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_STATUS_VERSION_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_STATUS_VERSION__EHR_STATUS_VERSION_EHR_ID_FKEY, + Keys.EHR_STATUS_VERSION__EHR_STATUS_VERSION_CONTRIBUTION_ID_FKEY, + Keys.EHR_STATUS_VERSION__EHR_STATUS_VERSION_AUDIT_ID_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_STATUS_VERSION__EHR_STATUS_VERSION_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution(this, Keys.EHR_STATUS_VERSION__EHR_STATUS_VERSION_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = new AuditDetails(this, Keys.EHR_STATUS_VERSION__EHR_STATUS_VERSION_AUDIT_ID_FKEY); + + return _auditDetails; + } + + @Override + public EhrStatusVersion as(String alias) { + return new EhrStatusVersion(DSL.name(alias), this); + } + + @Override + public EhrStatusVersion as(Name alias) { + return new EhrStatusVersion(alias, this); + } + + @Override + public EhrStatusVersion as(Table alias) { + return new EhrStatusVersion(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrStatusVersion rename(String name) { + return new EhrStatusVersion(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusVersion rename(Name name) { + return new EhrStatusVersion(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusVersion rename(Table name) { + return new EhrStatusVersion(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function6< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function6< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersionHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersionHistory.java new file mode 100644 index 0000000..4b65a55 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/EhrStatusVersionHistory.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.EhrStatusVersionHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function8; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row8; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusVersionHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.ehr_status_version_history + */ + public static final EhrStatusVersionHistory EHR_STATUS_VERSION_HISTORY = new EhrStatusVersionHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return EhrStatusVersionHistoryRecord.class; + } + + /** + * The column ehr.ehr_status_version_history.vo_id. + */ + public final TableField VO_ID = + createField(DSL.name("vo_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version_history.ehr_id. + */ + public final TableField EHR_ID = + createField(DSL.name("ehr_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version_history.contribution_id. + */ + public final TableField CONTRIBUTION_ID = + createField(DSL.name("contribution_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version_history.audit_id. + */ + public final TableField AUDIT_ID = + createField(DSL.name("audit_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version_history.sys_version. + */ + public final TableField SYS_VERSION = + createField(DSL.name("sys_version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version_history.sys_period_lower. + */ + public final TableField SYS_PERIOD_LOWER = createField( + DSL.name("sys_period_lower"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column ehr.ehr_status_version_history.sys_period_upper. + */ + public final TableField SYS_PERIOD_UPPER = + createField(DSL.name("sys_period_upper"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); + + /** + * The column ehr.ehr_status_version_history.sys_deleted. + */ + public final TableField SYS_DELETED = + createField(DSL.name("sys_deleted"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + private EhrStatusVersionHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private EhrStatusVersionHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.ehr_status_version_history table + * reference + */ + public EhrStatusVersionHistory(String alias) { + this(DSL.name(alias), EHR_STATUS_VERSION_HISTORY); + } + + /** + * Create an aliased ehr.ehr_status_version_history table + * reference + */ + public EhrStatusVersionHistory(Name alias) { + this(alias, EHR_STATUS_VERSION_HISTORY); + } + + /** + * Create a ehr.ehr_status_version_history table reference + */ + public EhrStatusVersionHistory() { + this(DSL.name("ehr_status_version_history"), null); + } + + public EhrStatusVersionHistory( + Table child, ForeignKey key) { + super(child, key, EHR_STATUS_VERSION_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.EHR_STATUS_VERSION_HISTORY_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList( + Keys.EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_EHR_ID_FKEY, + Keys.EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_CONTRIBUTION_ID_FKEY, + Keys.EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_AUDIT_ID_FKEY); + } + + private transient org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr _ehr; + private transient Contribution _contribution; + private transient AuditDetails _auditDetails; + + /** + * Get the implicit join path to the ehr.ehr table. + */ + public org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr ehr() { + if (_ehr == null) + _ehr = new org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr( + this, Keys.EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_EHR_ID_FKEY); + + return _ehr; + } + + /** + * Get the implicit join path to the ehr.contribution table. + */ + public Contribution contribution() { + if (_contribution == null) + _contribution = new Contribution( + this, Keys.EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_CONTRIBUTION_ID_FKEY); + + return _contribution; + } + + /** + * Get the implicit join path to the ehr.audit_details table. + */ + public AuditDetails auditDetails() { + if (_auditDetails == null) + _auditDetails = + new AuditDetails(this, Keys.EHR_STATUS_VERSION_HISTORY__EHR_STATUS_VERSION_HISTORY_AUDIT_ID_FKEY); + + return _auditDetails; + } + + @Override + public EhrStatusVersionHistory as(String alias) { + return new EhrStatusVersionHistory(DSL.name(alias), this); + } + + @Override + public EhrStatusVersionHistory as(Name alias) { + return new EhrStatusVersionHistory(alias, this); + } + + @Override + public EhrStatusVersionHistory as(Table alias) { + return new EhrStatusVersionHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public EhrStatusVersionHistory rename(String name) { + return new EhrStatusVersionHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusVersionHistory rename(Name name) { + return new EhrStatusVersionHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public EhrStatusVersionHistory rename(Table name) { + return new EhrStatusVersionHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function8< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super OffsetDateTime, + ? super Boolean, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function8< + ? super UUID, + ? super UUID, + ? super UUID, + ? super UUID, + ? super Integer, + ? super OffsetDateTime, + ? super OffsetDateTime, + ? super Boolean, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/FlywaySchemaHistory.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/FlywaySchemaHistory.java new file mode 100644 index 0000000..e8fa5d6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/FlywaySchemaHistory.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.FlywaySchemaHistoryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function10; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row10; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class FlywaySchemaHistory extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.flyway_schema_history + */ + public static final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = new FlywaySchemaHistory(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return FlywaySchemaHistoryRecord.class; + } + + /** + * The column ehr.flyway_schema_history.installed_rank. + */ + public final TableField INSTALLED_RANK = + createField(DSL.name("installed_rank"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.version. + */ + public final TableField VERSION = + createField(DSL.name("version"), SQLDataType.VARCHAR(50), this, ""); + + /** + * The column ehr.flyway_schema_history.description. + */ + public final TableField DESCRIPTION = + createField(DSL.name("description"), SQLDataType.VARCHAR(200).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.type. + */ + public final TableField TYPE = + createField(DSL.name("type"), SQLDataType.VARCHAR(20).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.script. + */ + public final TableField SCRIPT = + createField(DSL.name("script"), SQLDataType.VARCHAR(1000).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.checksum. + */ + public final TableField CHECKSUM = + createField(DSL.name("checksum"), SQLDataType.INTEGER, this, ""); + + /** + * The column ehr.flyway_schema_history.installed_by. + */ + public final TableField INSTALLED_BY = + createField(DSL.name("installed_by"), SQLDataType.VARCHAR(100).nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.installed_on. + */ + public final TableField INSTALLED_ON = createField( + DSL.name("installed_on"), + SQLDataType.LOCALDATETIME(6) + .nullable(false) + .defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), + this, + ""); + + /** + * The column ehr.flyway_schema_history.execution_time. + */ + public final TableField EXECUTION_TIME = + createField(DSL.name("execution_time"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column ehr.flyway_schema_history.success. + */ + public final TableField SUCCESS = + createField(DSL.name("success"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + private FlywaySchemaHistory(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private FlywaySchemaHistory(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.flyway_schema_history table reference + */ + public FlywaySchemaHistory(String alias) { + this(DSL.name(alias), FLYWAY_SCHEMA_HISTORY); + } + + /** + * Create an aliased ehr.flyway_schema_history table reference + */ + public FlywaySchemaHistory(Name alias) { + this(alias, FLYWAY_SCHEMA_HISTORY); + } + + /** + * Create a ehr.flyway_schema_history table reference + */ + public FlywaySchemaHistory() { + this(DSL.name("flyway_schema_history"), null); + } + + public FlywaySchemaHistory(Table child, ForeignKey key) { + super(child, key, FLYWAY_SCHEMA_HISTORY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FLYWAY_SCHEMA_HISTORY_S_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FLYWAY_SCHEMA_HISTORY_PK; + } + + @Override + public FlywaySchemaHistory as(String alias) { + return new FlywaySchemaHistory(DSL.name(alias), this); + } + + @Override + public FlywaySchemaHistory as(Name alias) { + return new FlywaySchemaHistory(alias, this); + } + + @Override + public FlywaySchemaHistory as(Table alias) { + return new FlywaySchemaHistory(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(String name) { + return new FlywaySchemaHistory(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(Name name) { + return new FlywaySchemaHistory(name, null); + } + + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(Table name) { + return new FlywaySchemaHistory(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row10 type methods + // ------------------------------------------------------------------------- + + @Override + public Row10 + fieldsRow() { + return (Row10) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function10< + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super String, + ? super LocalDateTime, + ? super Integer, + ? super Boolean, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function10< + ? super Integer, + ? super String, + ? super String, + ? super String, + ? super String, + ? super Integer, + ? super String, + ? super LocalDateTime, + ? super Integer, + ? super Boolean, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Plugin.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Plugin.java new file mode 100644 index 0000000..ee4a547 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Plugin.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.PluginRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * key value store for plugin sub system + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Plugin extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.plugin + */ + public static final Plugin PLUGIN = new Plugin(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return PluginRecord.class; + } + + /** + * The column ehr.plugin.id. + */ + public final TableField ID = createField( + DSL.name("id"), + SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), + this, + ""); + + /** + * The column ehr.plugin.pluginid. + */ + public final TableField PLUGINID = + createField(DSL.name("pluginid"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.plugin.key. + */ + public final TableField KEY = + createField(DSL.name("key"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.plugin.value. + */ + public final TableField VALUE = createField(DSL.name("value"), SQLDataType.CLOB, this, ""); + + private Plugin(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Plugin(Name alias, Table aliased, Field[] parameters) { + super( + alias, + null, + aliased, + parameters, + DSL.comment("key value store for plugin sub system"), + TableOptions.table()); + } + + /** + * Create an aliased ehr.plugin table reference + */ + public Plugin(String alias) { + this(DSL.name(alias), PLUGIN); + } + + /** + * Create an aliased ehr.plugin table reference + */ + public Plugin(Name alias) { + this(alias, PLUGIN); + } + + /** + * Create a ehr.plugin table reference + */ + public Plugin() { + this(DSL.name("plugin"), null); + } + + public Plugin(Table child, ForeignKey key) { + super(child, key, PLUGIN); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PLUGIN_PKEY; + } + + @Override + public Plugin as(String alias) { + return new Plugin(DSL.name(alias), this); + } + + @Override + public Plugin as(Name alias) { + return new Plugin(alias, this); + } + + @Override + public Plugin as(Table alias) { + return new Plugin(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Plugin rename(String name) { + return new Plugin(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Plugin rename(Name name) { + return new Plugin(name, null); + } + + /** + * Rename this table + */ + @Override + public Plugin rename(Table name) { + return new Plugin(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/StoredQuery.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/StoredQuery.java new file mode 100644 index 0000000..96601c4 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/StoredQuery.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.StoredQueryRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function6; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class StoredQuery extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.stored_query + */ + public static final StoredQuery STORED_QUERY = new StoredQuery(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return StoredQueryRecord.class; + } + + /** + * The column ehr.stored_query.reverse_domain_name. + */ + public final TableField REVERSE_DOMAIN_NAME = + createField(DSL.name("reverse_domain_name"), SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column ehr.stored_query.semantic_id. + */ + public final TableField SEMANTIC_ID = + createField(DSL.name("semantic_id"), SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column ehr.stored_query.semver. + */ + public final TableField SEMVER = createField( + DSL.name("semver"), + SQLDataType.VARCHAR + .nullable(false) + .defaultValue(DSL.field(DSL.raw("'0.0.0'::character varying"), SQLDataType.VARCHAR)), + this, + ""); + + /** + * The column ehr.stored_query.query_text. + */ + public final TableField QUERY_TEXT = + createField(DSL.name("query_text"), SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column ehr.stored_query.type. + */ + public final TableField TYPE = createField( + DSL.name("type"), + SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'AQL'::character varying"), SQLDataType.VARCHAR)), + this, + ""); + + /** + * The column ehr.stored_query.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private StoredQuery(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private StoredQuery(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.stored_query table reference + */ + public StoredQuery(String alias) { + this(DSL.name(alias), STORED_QUERY); + } + + /** + * Create an aliased ehr.stored_query table reference + */ + public StoredQuery(Name alias) { + this(alias, STORED_QUERY); + } + + /** + * Create a ehr.stored_query table reference + */ + public StoredQuery() { + this(DSL.name("stored_query"), null); + } + + public StoredQuery(Table child, ForeignKey key) { + super(child, key, STORED_QUERY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STORED_QUERY_PKEY; + } + + @Override + public StoredQuery as(String alias) { + return new StoredQuery(DSL.name(alias), this); + } + + @Override + public StoredQuery as(Name alias) { + return new StoredQuery(alias, this); + } + + @Override + public StoredQuery as(Table alias) { + return new StoredQuery(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public StoredQuery rename(String name) { + return new StoredQuery(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public StoredQuery rename(Name name) { + return new StoredQuery(name, null); + } + + /** + * Rename this table + */ + @Override + public StoredQuery rename(Table name) { + return new StoredQuery(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function6< + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super OffsetDateTime, + ? extends U> + from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function6< + ? super String, + ? super String, + ? super String, + ? super String, + ? super String, + ? super OffsetDateTime, + ? extends U> + from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/TemplateStore.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/TemplateStore.java new file mode 100644 index 0000000..68f3162 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/TemplateStore.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.TemplateStoreRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class TemplateStore extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.template_store + */ + public static final TemplateStore TEMPLATE_STORE = new TemplateStore(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TemplateStoreRecord.class; + } + + /** + * The column ehr.template_store.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.template_store.template_id. + */ + public final TableField TEMPLATE_ID = + createField(DSL.name("template_id"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column ehr.template_store.content. + */ + public final TableField CONTENT = + createField(DSL.name("content"), SQLDataType.CLOB, this, ""); + + /** + * The column ehr.template_store.creation_time. + */ + public final TableField CREATION_TIME = createField( + DSL.name("creation_time"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private TemplateStore(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TemplateStore(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.template_store table reference + */ + public TemplateStore(String alias) { + this(DSL.name(alias), TEMPLATE_STORE); + } + + /** + * Create an aliased ehr.template_store table reference + */ + public TemplateStore(Name alias) { + this(alias, TEMPLATE_STORE); + } + + /** + * Create a ehr.template_store table reference + */ + public TemplateStore() { + this(DSL.name("template_store"), null); + } + + public TemplateStore(Table child, ForeignKey key) { + super(child, key, TEMPLATE_STORE); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TEMPLATE_STORE_ID_UNQ); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TEMPLATE_STORE_PKEY; + } + + @Override + public TemplateStore as(String alias) { + return new TemplateStore(DSL.name(alias), this); + } + + @Override + public TemplateStore as(Name alias) { + return new TemplateStore(alias, this); + } + + @Override + public TemplateStore as(Table alias) { + return new TemplateStore(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public TemplateStore rename(String name) { + return new TemplateStore(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TemplateStore rename(Name name) { + return new TemplateStore(name, null); + } + + /** + * Rename this table + */ + @Override + public TemplateStore rename(Table name) { + return new TemplateStore(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping( + Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping( + Class toType, + Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Users.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Users.java new file mode 100644 index 0000000..1dbef94 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/Users.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.function.Function; +import org.ehrbase.migration.importer.v4.jooq.pg.Indexes; +import org.ehrbase.migration.importer.v4.jooq.pg.Keys; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.records.UsersRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function2; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class Users extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of ehr.users + */ + public static final Users USERS = new Users(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return UsersRecord.class; + } + + /** + * The column ehr.users.id. + */ + public final TableField ID = + createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column ehr.users.username. + */ + public final TableField USERNAME = + createField(DSL.name("username"), SQLDataType.CLOB.nullable(false), this, ""); + + private Users(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Users(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased ehr.users table reference + */ + public Users(String alias) { + this(DSL.name(alias), USERS); + } + + /** + * Create an aliased ehr.users table reference + */ + public Users(Name alias) { + this(alias, USERS); + } + + /** + * Create a ehr.users table reference + */ + public Users() { + this(DSL.name("users"), null); + } + + public Users(Table child, ForeignKey key) { + super(child, key, USERS); + } + + @Override + public Schema getSchema() { + return aliased() ? null : org.ehrbase.migration.importer.v4.jooq.pg.Ehr.EHR; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USERS_USERNAME_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PKEY; + } + + @Override + public Users as(String alias) { + return new Users(DSL.name(alias), this); + } + + @Override + public Users as(Name alias) { + return new Users(alias, this); + } + + @Override + public Users as(Table alias) { + return new Users(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Users rename(String name) { + return new Users(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Users rename(Name name) { + return new Users(name, null); + } + + /** + * Rename this table + */ + @Override + public Users rename(Table name) { + return new Users(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/AuditDetailsRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/AuditDetailsRecord.java new file mode 100644 index 0000000..36db413 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/AuditDetailsRecord.java @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionChangeType; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.AuditDetails; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record1; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class AuditDetailsRecord extends UpdatableRecordImpl + implements Record7 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.audit_details.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.audit_details.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.audit_details.change_type. + */ + public void setChangeType(ContributionChangeType value) { + set(1, value); + } + + /** + * Getter for ehr.audit_details.change_type. + */ + public ContributionChangeType getChangeType() { + return (ContributionChangeType) get(1); + } + + /** + * Setter for ehr.audit_details.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for ehr.audit_details.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for ehr.audit_details.time_committed. + */ + public void setTimeCommitted(OffsetDateTime value) { + set(3, value); + } + + /** + * Getter for ehr.audit_details.time_committed. + */ + public OffsetDateTime getTimeCommitted() { + return (OffsetDateTime) get(3); + } + + /** + * Setter for ehr.audit_details.committer. + */ + public void setCommitter(JSONB value) { + set(4, value); + } + + /** + * Getter for ehr.audit_details.committer. + */ + public JSONB getCommitter() { + return (JSONB) get(4); + } + + /** + * Setter for ehr.audit_details.user_id. + */ + public void setUserId(UUID value) { + set(5, value); + } + + /** + * Getter for ehr.audit_details.user_id. + */ + public UUID getUserId() { + return (UUID) get(5); + } + + /** + * Setter for ehr.audit_details.target_type. + */ + public void setTargetType(String value) { + set(6, value); + } + + /** + * Getter for ehr.audit_details.target_type. + */ + public String getTargetType() { + return (String) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return AuditDetails.AUDIT_DETAILS.ID; + } + + @Override + public Field field2() { + return AuditDetails.AUDIT_DETAILS.CHANGE_TYPE; + } + + @Override + public Field field3() { + return AuditDetails.AUDIT_DETAILS.DESCRIPTION; + } + + @Override + public Field field4() { + return AuditDetails.AUDIT_DETAILS.TIME_COMMITTED; + } + + @Override + public Field field5() { + return AuditDetails.AUDIT_DETAILS.COMMITTER; + } + + @Override + public Field field6() { + return AuditDetails.AUDIT_DETAILS.USER_ID; + } + + @Override + public Field field7() { + return AuditDetails.AUDIT_DETAILS.TARGET_TYPE; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public ContributionChangeType component2() { + return getChangeType(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public OffsetDateTime component4() { + return getTimeCommitted(); + } + + @Override + public JSONB component5() { + return getCommitter(); + } + + @Override + public UUID component6() { + return getUserId(); + } + + @Override + public String component7() { + return getTargetType(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public ContributionChangeType value2() { + return getChangeType(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public OffsetDateTime value4() { + return getTimeCommitted(); + } + + @Override + public JSONB value5() { + return getCommitter(); + } + + @Override + public UUID value6() { + return getUserId(); + } + + @Override + public String value7() { + return getTargetType(); + } + + @Override + public AuditDetailsRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public AuditDetailsRecord value2(ContributionChangeType value) { + setChangeType(value); + return this; + } + + @Override + public AuditDetailsRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public AuditDetailsRecord value4(OffsetDateTime value) { + setTimeCommitted(value); + return this; + } + + @Override + public AuditDetailsRecord value5(JSONB value) { + setCommitter(value); + return this; + } + + @Override + public AuditDetailsRecord value6(UUID value) { + setUserId(value); + return this; + } + + @Override + public AuditDetailsRecord value7(String value) { + setTargetType(value); + return this; + } + + @Override + public AuditDetailsRecord values( + UUID value1, + ContributionChangeType value2, + String value3, + OffsetDateTime value4, + JSONB value5, + UUID value6, + String value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AuditDetailsRecord + */ + public AuditDetailsRecord() { + super(AuditDetails.AUDIT_DETAILS); + } + + /** + * Create a detached, initialised AuditDetailsRecord + */ + public AuditDetailsRecord( + UUID id, + ContributionChangeType changeType, + String description, + OffsetDateTime timeCommitted, + JSONB committer, + UUID userId, + String targetType) { + super(AuditDetails.AUDIT_DETAILS); + + setId(id); + setChangeType(changeType); + setDescription(description); + setTimeCommitted(timeCommitted); + setCommitter(committer); + setUserId(userId); + setTargetType(targetType); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataHistoryRecord.java new file mode 100644 index 0000000..f2ebb47 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataHistoryRecord.java @@ -0,0 +1,675 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompDataHistory; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record14; +import org.jooq.Record3; +import org.jooq.Row14; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompDataHistoryRecord extends UpdatableRecordImpl + implements Record14< + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.comp_data_history.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.comp_data_history.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.comp_data_history.num. + */ + public void setNum(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.comp_data_history.num. + */ + public Integer getNum() { + return (Integer) get(1); + } + + /** + * Setter for ehr.comp_data_history.citem_num. + */ + public void setCitemNum(Integer value) { + set(2, value); + } + + /** + * Getter for ehr.comp_data_history.citem_num. + */ + public Integer getCitemNum() { + return (Integer) get(2); + } + + /** + * Setter for ehr.comp_data_history.rm_entity. + */ + public void setRmEntity(String value) { + set(3, value); + } + + /** + * Getter for ehr.comp_data_history.rm_entity. + */ + public String getRmEntity() { + return (String) get(3); + } + + /** + * Setter for ehr.comp_data_history.entity_concept. + */ + public void setEntityConcept(String value) { + set(4, value); + } + + /** + * Getter for ehr.comp_data_history.entity_concept. + */ + public String getEntityConcept() { + return (String) get(4); + } + + /** + * Setter for ehr.comp_data_history.entity_name. + */ + public void setEntityName(String value) { + set(5, value); + } + + /** + * Getter for ehr.comp_data_history.entity_name. + */ + public String getEntityName() { + return (String) get(5); + } + + /** + * Setter for ehr.comp_data_history.entity_attribute. + */ + public void setEntityAttribute(String value) { + set(6, value); + } + + /** + * Getter for ehr.comp_data_history.entity_attribute. + */ + public String getEntityAttribute() { + return (String) get(6); + } + + /** + * Setter for ehr.comp_data_history.entity_path. + */ + public void setEntityPath(String value) { + set(7, value); + } + + /** + * Getter for ehr.comp_data_history.entity_path. + */ + public String getEntityPath() { + return (String) get(7); + } + + /** + * Setter for ehr.comp_data_history.entity_path_cap. + */ + public void setEntityPathCap(String value) { + set(8, value); + } + + /** + * Getter for ehr.comp_data_history.entity_path_cap. + */ + public String getEntityPathCap() { + return (String) get(8); + } + + /** + * Setter for ehr.comp_data_history.entity_idx. + */ + public void setEntityIdx(String value) { + set(9, value); + } + + /** + * Getter for ehr.comp_data_history.entity_idx. + */ + public String getEntityIdx() { + return (String) get(9); + } + + /** + * Setter for ehr.comp_data_history.entity_idx_cap. + */ + public void setEntityIdxCap(String value) { + set(10, value); + } + + /** + * Getter for ehr.comp_data_history.entity_idx_cap. + */ + public String getEntityIdxCap() { + return (String) get(10); + } + + /** + * Setter for ehr.comp_data_history.entity_idx_len. + */ + public void setEntityIdxLen(Integer value) { + set(11, value); + } + + /** + * Getter for ehr.comp_data_history.entity_idx_len. + */ + public Integer getEntityIdxLen() { + return (Integer) get(11); + } + + /** + * Setter for ehr.comp_data_history.data. + */ + public void setData(JSONB value) { + set(12, value); + } + + /** + * Getter for ehr.comp_data_history.data. + */ + public JSONB getData() { + return (JSONB) get(12); + } + + /** + * Setter for ehr.comp_data_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(13, value); + } + + /** + * Getter for ehr.comp_data_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(13); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record3 key() { + return (Record3) super.key(); + } + + // ------------------------------------------------------------------------- + // Record14 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + @Override + public Row14< + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + valuesRow() { + return (Row14) super.valuesRow(); + } + + @Override + public Field field1() { + return CompDataHistory.COMP_DATA_HISTORY.VO_ID; + } + + @Override + public Field field2() { + return CompDataHistory.COMP_DATA_HISTORY.NUM; + } + + @Override + public Field field3() { + return CompDataHistory.COMP_DATA_HISTORY.CITEM_NUM; + } + + @Override + public Field field4() { + return CompDataHistory.COMP_DATA_HISTORY.RM_ENTITY; + } + + @Override + public Field field5() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_CONCEPT; + } + + @Override + public Field field6() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_NAME; + } + + @Override + public Field field7() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_ATTRIBUTE; + } + + @Override + public Field field8() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_PATH; + } + + @Override + public Field field9() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_PATH_CAP; + } + + @Override + public Field field10() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_IDX; + } + + @Override + public Field field11() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_IDX_CAP; + } + + @Override + public Field field12() { + return CompDataHistory.COMP_DATA_HISTORY.ENTITY_IDX_LEN; + } + + @Override + public Field field13() { + return CompDataHistory.COMP_DATA_HISTORY.DATA; + } + + @Override + public Field field14() { + return CompDataHistory.COMP_DATA_HISTORY.SYS_VERSION; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public Integer component2() { + return getNum(); + } + + @Override + public Integer component3() { + return getCitemNum(); + } + + @Override + public String component4() { + return getRmEntity(); + } + + @Override + public String component5() { + return getEntityConcept(); + } + + @Override + public String component6() { + return getEntityName(); + } + + @Override + public String component7() { + return getEntityAttribute(); + } + + @Override + public String component8() { + return getEntityPath(); + } + + @Override + public String component9() { + return getEntityPathCap(); + } + + @Override + public String component10() { + return getEntityIdx(); + } + + @Override + public String component11() { + return getEntityIdxCap(); + } + + @Override + public Integer component12() { + return getEntityIdxLen(); + } + + @Override + public JSONB component13() { + return getData(); + } + + @Override + public Integer component14() { + return getSysVersion(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public Integer value2() { + return getNum(); + } + + @Override + public Integer value3() { + return getCitemNum(); + } + + @Override + public String value4() { + return getRmEntity(); + } + + @Override + public String value5() { + return getEntityConcept(); + } + + @Override + public String value6() { + return getEntityName(); + } + + @Override + public String value7() { + return getEntityAttribute(); + } + + @Override + public String value8() { + return getEntityPath(); + } + + @Override + public String value9() { + return getEntityPathCap(); + } + + @Override + public String value10() { + return getEntityIdx(); + } + + @Override + public String value11() { + return getEntityIdxCap(); + } + + @Override + public Integer value12() { + return getEntityIdxLen(); + } + + @Override + public JSONB value13() { + return getData(); + } + + @Override + public Integer value14() { + return getSysVersion(); + } + + @Override + public CompDataHistoryRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public CompDataHistoryRecord value2(Integer value) { + setNum(value); + return this; + } + + @Override + public CompDataHistoryRecord value3(Integer value) { + setCitemNum(value); + return this; + } + + @Override + public CompDataHistoryRecord value4(String value) { + setRmEntity(value); + return this; + } + + @Override + public CompDataHistoryRecord value5(String value) { + setEntityConcept(value); + return this; + } + + @Override + public CompDataHistoryRecord value6(String value) { + setEntityName(value); + return this; + } + + @Override + public CompDataHistoryRecord value7(String value) { + setEntityAttribute(value); + return this; + } + + @Override + public CompDataHistoryRecord value8(String value) { + setEntityPath(value); + return this; + } + + @Override + public CompDataHistoryRecord value9(String value) { + setEntityPathCap(value); + return this; + } + + @Override + public CompDataHistoryRecord value10(String value) { + setEntityIdx(value); + return this; + } + + @Override + public CompDataHistoryRecord value11(String value) { + setEntityIdxCap(value); + return this; + } + + @Override + public CompDataHistoryRecord value12(Integer value) { + setEntityIdxLen(value); + return this; + } + + @Override + public CompDataHistoryRecord value13(JSONB value) { + setData(value); + return this; + } + + @Override + public CompDataHistoryRecord value14(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public CompDataHistoryRecord values( + UUID value1, + Integer value2, + Integer value3, + String value4, + String value5, + String value6, + String value7, + String value8, + String value9, + String value10, + String value11, + Integer value12, + JSONB value13, + Integer value14) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompDataHistoryRecord + */ + public CompDataHistoryRecord() { + super(CompDataHistory.COMP_DATA_HISTORY); + } + + /** + * Create a detached, initialised CompDataHistoryRecord + */ + public CompDataHistoryRecord( + UUID voId, + Integer num, + Integer citemNum, + String rmEntity, + String entityConcept, + String entityName, + String entityAttribute, + String entityPath, + String entityPathCap, + String entityIdx, + String entityIdxCap, + Integer entityIdxLen, + JSONB data, + Integer sysVersion) { + super(CompDataHistory.COMP_DATA_HISTORY); + + setVoId(voId); + setNum(num); + setCitemNum(citemNum); + setRmEntity(rmEntity); + setEntityConcept(entityConcept); + setEntityName(entityName); + setEntityAttribute(entityAttribute); + setEntityPath(entityPath); + setEntityPathCap(entityPathCap); + setEntityIdx(entityIdx); + setEntityIdxCap(entityIdxCap); + setEntityIdxLen(entityIdxLen); + setData(data); + setSysVersion(sysVersion); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataRecord.java new file mode 100644 index 0000000..813ac4c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompDataRecord.java @@ -0,0 +1,607 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompData; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record13; +import org.jooq.Record2; +import org.jooq.Row13; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompDataRecord extends UpdatableRecordImpl + implements Record13< + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.comp_data.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.comp_data.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.comp_data.num. + */ + public void setNum(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.comp_data.num. + */ + public Integer getNum() { + return (Integer) get(1); + } + + /** + * Setter for ehr.comp_data.citem_num. + */ + public void setCitemNum(Integer value) { + set(2, value); + } + + /** + * Getter for ehr.comp_data.citem_num. + */ + public Integer getCitemNum() { + return (Integer) get(2); + } + + /** + * Setter for ehr.comp_data.rm_entity. + */ + public void setRmEntity(String value) { + set(3, value); + } + + /** + * Getter for ehr.comp_data.rm_entity. + */ + public String getRmEntity() { + return (String) get(3); + } + + /** + * Setter for ehr.comp_data.entity_concept. + */ + public void setEntityConcept(String value) { + set(4, value); + } + + /** + * Getter for ehr.comp_data.entity_concept. + */ + public String getEntityConcept() { + return (String) get(4); + } + + /** + * Setter for ehr.comp_data.entity_name. + */ + public void setEntityName(String value) { + set(5, value); + } + + /** + * Getter for ehr.comp_data.entity_name. + */ + public String getEntityName() { + return (String) get(5); + } + + /** + * Setter for ehr.comp_data.entity_attribute. + */ + public void setEntityAttribute(String value) { + set(6, value); + } + + /** + * Getter for ehr.comp_data.entity_attribute. + */ + public String getEntityAttribute() { + return (String) get(6); + } + + /** + * Setter for ehr.comp_data.entity_path. + */ + public void setEntityPath(String value) { + set(7, value); + } + + /** + * Getter for ehr.comp_data.entity_path. + */ + public String getEntityPath() { + return (String) get(7); + } + + /** + * Setter for ehr.comp_data.entity_path_cap. + */ + public void setEntityPathCap(String value) { + set(8, value); + } + + /** + * Getter for ehr.comp_data.entity_path_cap. + */ + public String getEntityPathCap() { + return (String) get(8); + } + + /** + * Setter for ehr.comp_data.entity_idx. + */ + public void setEntityIdx(String value) { + set(9, value); + } + + /** + * Getter for ehr.comp_data.entity_idx. + */ + public String getEntityIdx() { + return (String) get(9); + } + + /** + * Setter for ehr.comp_data.entity_idx_cap. + */ + public void setEntityIdxCap(String value) { + set(10, value); + } + + /** + * Getter for ehr.comp_data.entity_idx_cap. + */ + public String getEntityIdxCap() { + return (String) get(10); + } + + /** + * Setter for ehr.comp_data.entity_idx_len. + */ + public void setEntityIdxLen(Integer value) { + set(11, value); + } + + /** + * Getter for ehr.comp_data.entity_idx_len. + */ + public Integer getEntityIdxLen() { + return (Integer) get(11); + } + + /** + * Setter for ehr.comp_data.data. + */ + public void setData(JSONB value) { + set(12, value); + } + + /** + * Getter for ehr.comp_data.data. + */ + public JSONB getData() { + return (JSONB) get(12); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record13 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row13 + fieldsRow() { + return (Row13) super.fieldsRow(); + } + + @Override + public Row13 + valuesRow() { + return (Row13) super.valuesRow(); + } + + @Override + public Field field1() { + return CompData.COMP_DATA.VO_ID; + } + + @Override + public Field field2() { + return CompData.COMP_DATA.NUM; + } + + @Override + public Field field3() { + return CompData.COMP_DATA.CITEM_NUM; + } + + @Override + public Field field4() { + return CompData.COMP_DATA.RM_ENTITY; + } + + @Override + public Field field5() { + return CompData.COMP_DATA.ENTITY_CONCEPT; + } + + @Override + public Field field6() { + return CompData.COMP_DATA.ENTITY_NAME; + } + + @Override + public Field field7() { + return CompData.COMP_DATA.ENTITY_ATTRIBUTE; + } + + @Override + public Field field8() { + return CompData.COMP_DATA.ENTITY_PATH; + } + + @Override + public Field field9() { + return CompData.COMP_DATA.ENTITY_PATH_CAP; + } + + @Override + public Field field10() { + return CompData.COMP_DATA.ENTITY_IDX; + } + + @Override + public Field field11() { + return CompData.COMP_DATA.ENTITY_IDX_CAP; + } + + @Override + public Field field12() { + return CompData.COMP_DATA.ENTITY_IDX_LEN; + } + + @Override + public Field field13() { + return CompData.COMP_DATA.DATA; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public Integer component2() { + return getNum(); + } + + @Override + public Integer component3() { + return getCitemNum(); + } + + @Override + public String component4() { + return getRmEntity(); + } + + @Override + public String component5() { + return getEntityConcept(); + } + + @Override + public String component6() { + return getEntityName(); + } + + @Override + public String component7() { + return getEntityAttribute(); + } + + @Override + public String component8() { + return getEntityPath(); + } + + @Override + public String component9() { + return getEntityPathCap(); + } + + @Override + public String component10() { + return getEntityIdx(); + } + + @Override + public String component11() { + return getEntityIdxCap(); + } + + @Override + public Integer component12() { + return getEntityIdxLen(); + } + + @Override + public JSONB component13() { + return getData(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public Integer value2() { + return getNum(); + } + + @Override + public Integer value3() { + return getCitemNum(); + } + + @Override + public String value4() { + return getRmEntity(); + } + + @Override + public String value5() { + return getEntityConcept(); + } + + @Override + public String value6() { + return getEntityName(); + } + + @Override + public String value7() { + return getEntityAttribute(); + } + + @Override + public String value8() { + return getEntityPath(); + } + + @Override + public String value9() { + return getEntityPathCap(); + } + + @Override + public String value10() { + return getEntityIdx(); + } + + @Override + public String value11() { + return getEntityIdxCap(); + } + + @Override + public Integer value12() { + return getEntityIdxLen(); + } + + @Override + public JSONB value13() { + return getData(); + } + + @Override + public CompDataRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public CompDataRecord value2(Integer value) { + setNum(value); + return this; + } + + @Override + public CompDataRecord value3(Integer value) { + setCitemNum(value); + return this; + } + + @Override + public CompDataRecord value4(String value) { + setRmEntity(value); + return this; + } + + @Override + public CompDataRecord value5(String value) { + setEntityConcept(value); + return this; + } + + @Override + public CompDataRecord value6(String value) { + setEntityName(value); + return this; + } + + @Override + public CompDataRecord value7(String value) { + setEntityAttribute(value); + return this; + } + + @Override + public CompDataRecord value8(String value) { + setEntityPath(value); + return this; + } + + @Override + public CompDataRecord value9(String value) { + setEntityPathCap(value); + return this; + } + + @Override + public CompDataRecord value10(String value) { + setEntityIdx(value); + return this; + } + + @Override + public CompDataRecord value11(String value) { + setEntityIdxCap(value); + return this; + } + + @Override + public CompDataRecord value12(Integer value) { + setEntityIdxLen(value); + return this; + } + + @Override + public CompDataRecord value13(JSONB value) { + setData(value); + return this; + } + + @Override + public CompDataRecord values( + UUID value1, + Integer value2, + Integer value3, + String value4, + String value5, + String value6, + String value7, + String value8, + String value9, + String value10, + String value11, + Integer value12, + JSONB value13) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompDataRecord + */ + public CompDataRecord() { + super(CompData.COMP_DATA); + } + + /** + * Create a detached, initialised CompDataRecord + */ + public CompDataRecord( + UUID voId, + Integer num, + Integer citemNum, + String rmEntity, + String entityConcept, + String entityName, + String entityAttribute, + String entityPath, + String entityPathCap, + String entityIdx, + String entityIdxCap, + Integer entityIdxLen, + JSONB data) { + super(CompData.COMP_DATA); + + setVoId(voId); + setNum(num); + setCitemNum(citemNum); + setRmEntity(rmEntity); + setEntityConcept(entityConcept); + setEntityName(entityName); + setEntityAttribute(entityAttribute); + setEntityPath(entityPath); + setEntityPathCap(entityPathCap); + setEntityIdx(entityIdx); + setEntityIdxCap(entityIdxCap); + setEntityIdxLen(entityIdxLen); + setData(data); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionHistoryRecord.java new file mode 100644 index 0000000..b6995c1 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionHistoryRecord.java @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersionHistory; +import org.jooq.Field; +import org.jooq.Record10; +import org.jooq.Record2; +import org.jooq.Row10; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompVersionHistoryRecord extends UpdatableRecordImpl + implements Record10 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.comp_version_history.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.comp_version_history.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.comp_version_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.comp_version_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.comp_version_history.contribution_id. + */ + public void setContributionId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.comp_version_history.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.comp_version_history.audit_id. + */ + public void setAuditId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.comp_version_history.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.comp_version_history.template_id. + */ + public void setTemplateId(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.comp_version_history.template_id. + */ + public UUID getTemplateId() { + return (UUID) get(4); + } + + /** + * Setter for ehr.comp_version_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(5, value); + } + + /** + * Getter for ehr.comp_version_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(5); + } + + /** + * Setter for ehr.comp_version_history.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(6, value); + } + + /** + * Getter for ehr.comp_version_history.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(6); + } + + /** + * Setter for ehr.comp_version_history.sys_period_upper. + */ + public void setSysPeriodUpper(OffsetDateTime value) { + set(7, value); + } + + /** + * Getter for ehr.comp_version_history.sys_period_upper. + */ + public OffsetDateTime getSysPeriodUpper() { + return (OffsetDateTime) get(7); + } + + /** + * Setter for ehr.comp_version_history.sys_deleted. + */ + public void setSysDeleted(Boolean value) { + set(8, value); + } + + /** + * Getter for ehr.comp_version_history.sys_deleted. + */ + public Boolean getSysDeleted() { + return (Boolean) get(8); + } + + /** + * Setter for ehr.comp_version_history.root_concept. + */ + public void setRootConcept(String value) { + set(9, value); + } + + /** + * Getter for ehr.comp_version_history.root_concept. + */ + public String getRootConcept() { + return (String) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + @Override + public Row10 valuesRow() { + return (Row10) super.valuesRow(); + } + + @Override + public Field field1() { + return CompVersionHistory.COMP_VERSION_HISTORY.VO_ID; + } + + @Override + public Field field2() { + return CompVersionHistory.COMP_VERSION_HISTORY.EHR_ID; + } + + @Override + public Field field3() { + return CompVersionHistory.COMP_VERSION_HISTORY.CONTRIBUTION_ID; + } + + @Override + public Field field4() { + return CompVersionHistory.COMP_VERSION_HISTORY.AUDIT_ID; + } + + @Override + public Field field5() { + return CompVersionHistory.COMP_VERSION_HISTORY.TEMPLATE_ID; + } + + @Override + public Field field6() { + return CompVersionHistory.COMP_VERSION_HISTORY.SYS_VERSION; + } + + @Override + public Field field7() { + return CompVersionHistory.COMP_VERSION_HISTORY.SYS_PERIOD_LOWER; + } + + @Override + public Field field8() { + return CompVersionHistory.COMP_VERSION_HISTORY.SYS_PERIOD_UPPER; + } + + @Override + public Field field9() { + return CompVersionHistory.COMP_VERSION_HISTORY.SYS_DELETED; + } + + @Override + public Field field10() { + return CompVersionHistory.COMP_VERSION_HISTORY.ROOT_CONCEPT; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getContributionId(); + } + + @Override + public UUID component4() { + return getAuditId(); + } + + @Override + public UUID component5() { + return getTemplateId(); + } + + @Override + public Integer component6() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component7() { + return getSysPeriodLower(); + } + + @Override + public OffsetDateTime component8() { + return getSysPeriodUpper(); + } + + @Override + public Boolean component9() { + return getSysDeleted(); + } + + @Override + public String component10() { + return getRootConcept(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getContributionId(); + } + + @Override + public UUID value4() { + return getAuditId(); + } + + @Override + public UUID value5() { + return getTemplateId(); + } + + @Override + public Integer value6() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value7() { + return getSysPeriodLower(); + } + + @Override + public OffsetDateTime value8() { + return getSysPeriodUpper(); + } + + @Override + public Boolean value9() { + return getSysDeleted(); + } + + @Override + public String value10() { + return getRootConcept(); + } + + @Override + public CompVersionHistoryRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public CompVersionHistoryRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public CompVersionHistoryRecord value3(UUID value) { + setContributionId(value); + return this; + } + + @Override + public CompVersionHistoryRecord value4(UUID value) { + setAuditId(value); + return this; + } + + @Override + public CompVersionHistoryRecord value5(UUID value) { + setTemplateId(value); + return this; + } + + @Override + public CompVersionHistoryRecord value6(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public CompVersionHistoryRecord value7(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public CompVersionHistoryRecord value8(OffsetDateTime value) { + setSysPeriodUpper(value); + return this; + } + + @Override + public CompVersionHistoryRecord value9(Boolean value) { + setSysDeleted(value); + return this; + } + + @Override + public CompVersionHistoryRecord value10(String value) { + setRootConcept(value); + return this; + } + + @Override + public CompVersionHistoryRecord values( + UUID value1, + UUID value2, + UUID value3, + UUID value4, + UUID value5, + Integer value6, + OffsetDateTime value7, + OffsetDateTime value8, + Boolean value9, + String value10) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompVersionHistoryRecord + */ + public CompVersionHistoryRecord() { + super(CompVersionHistory.COMP_VERSION_HISTORY); + } + + /** + * Create a detached, initialised CompVersionHistoryRecord + */ + public CompVersionHistoryRecord( + UUID voId, + UUID ehrId, + UUID contributionId, + UUID auditId, + UUID templateId, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + OffsetDateTime sysPeriodUpper, + Boolean sysDeleted, + String rootConcept) { + super(CompVersionHistory.COMP_VERSION_HISTORY); + + setVoId(voId); + setEhrId(ehrId); + setContributionId(contributionId); + setAuditId(auditId); + setTemplateId(templateId); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setSysPeriodUpper(sysPeriodUpper); + setSysDeleted(sysDeleted); + setRootConcept(rootConcept); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionRecord.java new file mode 100644 index 0000000..19b800c --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/CompVersionRecord.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.CompVersion; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record8; +import org.jooq.Row8; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class CompVersionRecord extends UpdatableRecordImpl + implements Record8 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.comp_version.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.comp_version.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.comp_version.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.comp_version.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.comp_version.contribution_id. + */ + public void setContributionId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.comp_version.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.comp_version.audit_id. + */ + public void setAuditId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.comp_version.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.comp_version.template_id. + */ + public void setTemplateId(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.comp_version.template_id. + */ + public UUID getTemplateId() { + return (UUID) get(4); + } + + /** + * Setter for ehr.comp_version.sys_version. + */ + public void setSysVersion(Integer value) { + set(5, value); + } + + /** + * Getter for ehr.comp_version.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(5); + } + + /** + * Setter for ehr.comp_version.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(6, value); + } + + /** + * Getter for ehr.comp_version.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(6); + } + + /** + * Setter for ehr.comp_version.root_concept. + */ + public void setRootConcept(String value) { + set(7, value); + } + + /** + * Getter for ehr.comp_version.root_concept. + */ + public String getRootConcept() { + return (String) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return CompVersion.COMP_VERSION.VO_ID; + } + + @Override + public Field field2() { + return CompVersion.COMP_VERSION.EHR_ID; + } + + @Override + public Field field3() { + return CompVersion.COMP_VERSION.CONTRIBUTION_ID; + } + + @Override + public Field field4() { + return CompVersion.COMP_VERSION.AUDIT_ID; + } + + @Override + public Field field5() { + return CompVersion.COMP_VERSION.TEMPLATE_ID; + } + + @Override + public Field field6() { + return CompVersion.COMP_VERSION.SYS_VERSION; + } + + @Override + public Field field7() { + return CompVersion.COMP_VERSION.SYS_PERIOD_LOWER; + } + + @Override + public Field field8() { + return CompVersion.COMP_VERSION.ROOT_CONCEPT; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getContributionId(); + } + + @Override + public UUID component4() { + return getAuditId(); + } + + @Override + public UUID component5() { + return getTemplateId(); + } + + @Override + public Integer component6() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component7() { + return getSysPeriodLower(); + } + + @Override + public String component8() { + return getRootConcept(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getContributionId(); + } + + @Override + public UUID value4() { + return getAuditId(); + } + + @Override + public UUID value5() { + return getTemplateId(); + } + + @Override + public Integer value6() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value7() { + return getSysPeriodLower(); + } + + @Override + public String value8() { + return getRootConcept(); + } + + @Override + public CompVersionRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public CompVersionRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public CompVersionRecord value3(UUID value) { + setContributionId(value); + return this; + } + + @Override + public CompVersionRecord value4(UUID value) { + setAuditId(value); + return this; + } + + @Override + public CompVersionRecord value5(UUID value) { + setTemplateId(value); + return this; + } + + @Override + public CompVersionRecord value6(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public CompVersionRecord value7(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public CompVersionRecord value8(String value) { + setRootConcept(value); + return this; + } + + @Override + public CompVersionRecord values( + UUID value1, + UUID value2, + UUID value3, + UUID value4, + UUID value5, + Integer value6, + OffsetDateTime value7, + String value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CompVersionRecord + */ + public CompVersionRecord() { + super(CompVersion.COMP_VERSION); + } + + /** + * Create a detached, initialised CompVersionRecord + */ + public CompVersionRecord( + UUID voId, + UUID ehrId, + UUID contributionId, + UUID auditId, + UUID templateId, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + String rootConcept) { + super(CompVersion.COMP_VERSION); + + setVoId(voId); + setEhrId(ehrId); + setContributionId(contributionId); + setAuditId(auditId); + setTemplateId(templateId); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setRootConcept(rootConcept); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/ContributionRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/ContributionRecord.java new file mode 100644 index 0000000..0bd40a6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/ContributionRecord.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.enums.ContributionDataType; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Contribution; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class ContributionRecord extends UpdatableRecordImpl + implements Record5 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.contribution.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.contribution.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.contribution.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.contribution.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.contribution.contribution_type. + */ + public void setContributionType(ContributionDataType value) { + set(2, value); + } + + /** + * Getter for ehr.contribution.contribution_type. + */ + public ContributionDataType getContributionType() { + return (ContributionDataType) get(2); + } + + /** + * Setter for ehr.contribution.signature. + */ + public void setSignature(String value) { + set(3, value); + } + + /** + * Getter for ehr.contribution.signature. + */ + public String getSignature() { + return (String) get(3); + } + + /** + * Setter for ehr.contribution.has_audit. + */ + public void setHasAudit(UUID value) { + set(4, value); + } + + /** + * Getter for ehr.contribution.has_audit. + */ + public UUID getHasAudit() { + return (UUID) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return Contribution.CONTRIBUTION.ID; + } + + @Override + public Field field2() { + return Contribution.CONTRIBUTION.EHR_ID; + } + + @Override + public Field field3() { + return Contribution.CONTRIBUTION.CONTRIBUTION_TYPE; + } + + @Override + public Field field4() { + return Contribution.CONTRIBUTION.SIGNATURE; + } + + @Override + public Field field5() { + return Contribution.CONTRIBUTION.HAS_AUDIT; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public ContributionDataType component3() { + return getContributionType(); + } + + @Override + public String component4() { + return getSignature(); + } + + @Override + public UUID component5() { + return getHasAudit(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public ContributionDataType value3() { + return getContributionType(); + } + + @Override + public String value4() { + return getSignature(); + } + + @Override + public UUID value5() { + return getHasAudit(); + } + + @Override + public ContributionRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public ContributionRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public ContributionRecord value3(ContributionDataType value) { + setContributionType(value); + return this; + } + + @Override + public ContributionRecord value4(String value) { + setSignature(value); + return this; + } + + @Override + public ContributionRecord value5(UUID value) { + setHasAudit(value); + return this; + } + + @Override + public ContributionRecord values( + UUID value1, UUID value2, ContributionDataType value3, String value4, UUID value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ContributionRecord + */ + public ContributionRecord() { + super(Contribution.CONTRIBUTION); + } + + /** + * Create a detached, initialised ContributionRecord + */ + public ContributionRecord( + UUID id, UUID ehrId, ContributionDataType contributionType, String signature, UUID hasAudit) { + super(Contribution.CONTRIBUTION); + + setId(id); + setEhrId(ehrId); + setContributionType(contributionType); + setSignature(signature); + setHasAudit(hasAudit); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataHistoryRecord.java new file mode 100644 index 0000000..11cec35 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataHistoryRecord.java @@ -0,0 +1,759 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderDataHistory; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record16; +import org.jooq.Record4; +import org.jooq.Row16; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderDataHistoryRecord extends UpdatableRecordImpl + implements Record16< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_folder_data_history.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_folder_data_history.num. + */ + public void setNum(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.num. + */ + public Integer getNum() { + return (Integer) get(1); + } + + /** + * Setter for ehr.ehr_folder_data_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_folder_data_history.ehr_folders_idx. + */ + public void setEhrFoldersIdx(Integer value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.ehr_folders_idx. + */ + public Integer getEhrFoldersIdx() { + return (Integer) get(3); + } + + /** + * Setter for ehr.ehr_folder_data_history.citem_num. + */ + public void setCitemNum(Integer value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.citem_num. + */ + public Integer getCitemNum() { + return (Integer) get(4); + } + + /** + * Setter for ehr.ehr_folder_data_history.rm_entity. + */ + public void setRmEntity(String value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.rm_entity. + */ + public String getRmEntity() { + return (String) get(5); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_concept. + */ + public void setEntityConcept(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_concept. + */ + public String getEntityConcept() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_name. + */ + public void setEntityName(String value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_name. + */ + public String getEntityName() { + return (String) get(7); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_attribute. + */ + public void setEntityAttribute(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_attribute. + */ + public String getEntityAttribute() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_path. + */ + public void setEntityPath(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_path. + */ + public String getEntityPath() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_path_cap. + */ + public void setEntityPathCap(String value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_path_cap. + */ + public String getEntityPathCap() { + return (String) get(10); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_idx. + */ + public void setEntityIdx(String value) { + set(11, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_idx. + */ + public String getEntityIdx() { + return (String) get(11); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_idx_cap. + */ + public void setEntityIdxCap(String value) { + set(12, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_idx_cap. + */ + public String getEntityIdxCap() { + return (String) get(12); + } + + /** + * Setter for ehr.ehr_folder_data_history.entity_idx_len. + */ + public void setEntityIdxLen(Integer value) { + set(13, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.entity_idx_len. + */ + public Integer getEntityIdxLen() { + return (Integer) get(13); + } + + /** + * Setter for ehr.ehr_folder_data_history.data. + */ + public void setData(JSONB value) { + set(14, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.data. + */ + public JSONB getData() { + return (JSONB) get(14); + } + + /** + * Setter for ehr.ehr_folder_data_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(15, value); + } + + /** + * Getter for ehr.ehr_folder_data_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(15); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record4 key() { + return (Record4) super.key(); + } + + // ------------------------------------------------------------------------- + // Record16 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row16< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + fieldsRow() { + return (Row16) super.fieldsRow(); + } + + @Override + public Row16< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + valuesRow() { + return (Row16) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.VO_ID; + } + + @Override + public Field field2() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.NUM; + } + + @Override + public Field field3() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_ID; + } + + @Override + public Field field4() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.EHR_FOLDERS_IDX; + } + + @Override + public Field field5() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.CITEM_NUM; + } + + @Override + public Field field6() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.RM_ENTITY; + } + + @Override + public Field field7() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_CONCEPT; + } + + @Override + public Field field8() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_NAME; + } + + @Override + public Field field9() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_ATTRIBUTE; + } + + @Override + public Field field10() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_PATH; + } + + @Override + public Field field11() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_PATH_CAP; + } + + @Override + public Field field12() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_IDX; + } + + @Override + public Field field13() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_IDX_CAP; + } + + @Override + public Field field14() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.ENTITY_IDX_LEN; + } + + @Override + public Field field15() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.DATA; + } + + @Override + public Field field16() { + return EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY.SYS_VERSION; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public Integer component2() { + return getNum(); + } + + @Override + public UUID component3() { + return getEhrId(); + } + + @Override + public Integer component4() { + return getEhrFoldersIdx(); + } + + @Override + public Integer component5() { + return getCitemNum(); + } + + @Override + public String component6() { + return getRmEntity(); + } + + @Override + public String component7() { + return getEntityConcept(); + } + + @Override + public String component8() { + return getEntityName(); + } + + @Override + public String component9() { + return getEntityAttribute(); + } + + @Override + public String component10() { + return getEntityPath(); + } + + @Override + public String component11() { + return getEntityPathCap(); + } + + @Override + public String component12() { + return getEntityIdx(); + } + + @Override + public String component13() { + return getEntityIdxCap(); + } + + @Override + public Integer component14() { + return getEntityIdxLen(); + } + + @Override + public JSONB component15() { + return getData(); + } + + @Override + public Integer component16() { + return getSysVersion(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public Integer value2() { + return getNum(); + } + + @Override + public UUID value3() { + return getEhrId(); + } + + @Override + public Integer value4() { + return getEhrFoldersIdx(); + } + + @Override + public Integer value5() { + return getCitemNum(); + } + + @Override + public String value6() { + return getRmEntity(); + } + + @Override + public String value7() { + return getEntityConcept(); + } + + @Override + public String value8() { + return getEntityName(); + } + + @Override + public String value9() { + return getEntityAttribute(); + } + + @Override + public String value10() { + return getEntityPath(); + } + + @Override + public String value11() { + return getEntityPathCap(); + } + + @Override + public String value12() { + return getEntityIdx(); + } + + @Override + public String value13() { + return getEntityIdxCap(); + } + + @Override + public Integer value14() { + return getEntityIdxLen(); + } + + @Override + public JSONB value15() { + return getData(); + } + + @Override + public Integer value16() { + return getSysVersion(); + } + + @Override + public EhrFolderDataHistoryRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value2(Integer value) { + setNum(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value3(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value4(Integer value) { + setEhrFoldersIdx(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value5(Integer value) { + setCitemNum(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value6(String value) { + setRmEntity(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value7(String value) { + setEntityConcept(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value8(String value) { + setEntityName(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value9(String value) { + setEntityAttribute(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value10(String value) { + setEntityPath(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value11(String value) { + setEntityPathCap(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value12(String value) { + setEntityIdx(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value13(String value) { + setEntityIdxCap(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value14(Integer value) { + setEntityIdxLen(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value15(JSONB value) { + setData(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord value16(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrFolderDataHistoryRecord values( + UUID value1, + Integer value2, + UUID value3, + Integer value4, + Integer value5, + String value6, + String value7, + String value8, + String value9, + String value10, + String value11, + String value12, + String value13, + Integer value14, + JSONB value15, + Integer value16) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + value16(value16); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrFolderDataHistoryRecord + */ + public EhrFolderDataHistoryRecord() { + super(EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY); + } + + /** + * Create a detached, initialised EhrFolderDataHistoryRecord + */ + public EhrFolderDataHistoryRecord( + UUID voId, + Integer num, + UUID ehrId, + Integer ehrFoldersIdx, + Integer citemNum, + String rmEntity, + String entityConcept, + String entityName, + String entityAttribute, + String entityPath, + String entityPathCap, + String entityIdx, + String entityIdxCap, + Integer entityIdxLen, + JSONB data, + Integer sysVersion) { + super(EhrFolderDataHistory.EHR_FOLDER_DATA_HISTORY); + + setVoId(voId); + setNum(num); + setEhrId(ehrId); + setEhrFoldersIdx(ehrFoldersIdx); + setCitemNum(citemNum); + setRmEntity(rmEntity); + setEntityConcept(entityConcept); + setEntityName(entityName); + setEntityAttribute(entityAttribute); + setEntityPath(entityPath); + setEntityPathCap(entityPathCap); + setEntityIdx(entityIdx); + setEntityIdxCap(entityIdxCap); + setEntityIdxLen(entityIdxLen); + setData(data); + setSysVersion(sysVersion); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataRecord.java new file mode 100644 index 0000000..7a6b24d --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderDataRecord.java @@ -0,0 +1,717 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderData; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record15; +import org.jooq.Record3; +import org.jooq.Row15; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderDataRecord extends UpdatableRecordImpl + implements Record15< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_folder_data.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_folder_data.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_folder_data.num. + */ + public void setNum(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_folder_data.num. + */ + public Integer getNum() { + return (Integer) get(1); + } + + /** + * Setter for ehr.ehr_folder_data.ehr_id. + */ + public void setEhrId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_folder_data.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_folder_data.ehr_folders_idx. + */ + public void setEhrFoldersIdx(Integer value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_folder_data.ehr_folders_idx. + */ + public Integer getEhrFoldersIdx() { + return (Integer) get(3); + } + + /** + * Setter for ehr.ehr_folder_data.citem_num. + */ + public void setCitemNum(Integer value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_folder_data.citem_num. + */ + public Integer getCitemNum() { + return (Integer) get(4); + } + + /** + * Setter for ehr.ehr_folder_data.rm_entity. + */ + public void setRmEntity(String value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_folder_data.rm_entity. + */ + public String getRmEntity() { + return (String) get(5); + } + + /** + * Setter for ehr.ehr_folder_data.entity_concept. + */ + public void setEntityConcept(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_concept. + */ + public String getEntityConcept() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_folder_data.entity_name. + */ + public void setEntityName(String value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_name. + */ + public String getEntityName() { + return (String) get(7); + } + + /** + * Setter for ehr.ehr_folder_data.entity_attribute. + */ + public void setEntityAttribute(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_attribute. + */ + public String getEntityAttribute() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_folder_data.entity_path. + */ + public void setEntityPath(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_path. + */ + public String getEntityPath() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_folder_data.entity_path_cap. + */ + public void setEntityPathCap(String value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_path_cap. + */ + public String getEntityPathCap() { + return (String) get(10); + } + + /** + * Setter for ehr.ehr_folder_data.entity_idx. + */ + public void setEntityIdx(String value) { + set(11, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_idx. + */ + public String getEntityIdx() { + return (String) get(11); + } + + /** + * Setter for ehr.ehr_folder_data.entity_idx_cap. + */ + public void setEntityIdxCap(String value) { + set(12, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_idx_cap. + */ + public String getEntityIdxCap() { + return (String) get(12); + } + + /** + * Setter for ehr.ehr_folder_data.entity_idx_len. + */ + public void setEntityIdxLen(Integer value) { + set(13, value); + } + + /** + * Getter for ehr.ehr_folder_data.entity_idx_len. + */ + public Integer getEntityIdxLen() { + return (Integer) get(13); + } + + /** + * Setter for ehr.ehr_folder_data.data. + */ + public void setData(JSONB value) { + set(14, value); + } + + /** + * Getter for ehr.ehr_folder_data.data. + */ + public JSONB getData() { + return (JSONB) get(14); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record3 key() { + return (Record3) super.key(); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15< + UUID, + Integer, + UUID, + Integer, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> + valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrFolderData.EHR_FOLDER_DATA.VO_ID; + } + + @Override + public Field field2() { + return EhrFolderData.EHR_FOLDER_DATA.NUM; + } + + @Override + public Field field3() { + return EhrFolderData.EHR_FOLDER_DATA.EHR_ID; + } + + @Override + public Field field4() { + return EhrFolderData.EHR_FOLDER_DATA.EHR_FOLDERS_IDX; + } + + @Override + public Field field5() { + return EhrFolderData.EHR_FOLDER_DATA.CITEM_NUM; + } + + @Override + public Field field6() { + return EhrFolderData.EHR_FOLDER_DATA.RM_ENTITY; + } + + @Override + public Field field7() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_CONCEPT; + } + + @Override + public Field field8() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_NAME; + } + + @Override + public Field field9() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_ATTRIBUTE; + } + + @Override + public Field field10() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_PATH; + } + + @Override + public Field field11() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_PATH_CAP; + } + + @Override + public Field field12() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_IDX; + } + + @Override + public Field field13() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_IDX_CAP; + } + + @Override + public Field field14() { + return EhrFolderData.EHR_FOLDER_DATA.ENTITY_IDX_LEN; + } + + @Override + public Field field15() { + return EhrFolderData.EHR_FOLDER_DATA.DATA; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public Integer component2() { + return getNum(); + } + + @Override + public UUID component3() { + return getEhrId(); + } + + @Override + public Integer component4() { + return getEhrFoldersIdx(); + } + + @Override + public Integer component5() { + return getCitemNum(); + } + + @Override + public String component6() { + return getRmEntity(); + } + + @Override + public String component7() { + return getEntityConcept(); + } + + @Override + public String component8() { + return getEntityName(); + } + + @Override + public String component9() { + return getEntityAttribute(); + } + + @Override + public String component10() { + return getEntityPath(); + } + + @Override + public String component11() { + return getEntityPathCap(); + } + + @Override + public String component12() { + return getEntityIdx(); + } + + @Override + public String component13() { + return getEntityIdxCap(); + } + + @Override + public Integer component14() { + return getEntityIdxLen(); + } + + @Override + public JSONB component15() { + return getData(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public Integer value2() { + return getNum(); + } + + @Override + public UUID value3() { + return getEhrId(); + } + + @Override + public Integer value4() { + return getEhrFoldersIdx(); + } + + @Override + public Integer value5() { + return getCitemNum(); + } + + @Override + public String value6() { + return getRmEntity(); + } + + @Override + public String value7() { + return getEntityConcept(); + } + + @Override + public String value8() { + return getEntityName(); + } + + @Override + public String value9() { + return getEntityAttribute(); + } + + @Override + public String value10() { + return getEntityPath(); + } + + @Override + public String value11() { + return getEntityPathCap(); + } + + @Override + public String value12() { + return getEntityIdx(); + } + + @Override + public String value13() { + return getEntityIdxCap(); + } + + @Override + public Integer value14() { + return getEntityIdxLen(); + } + + @Override + public JSONB value15() { + return getData(); + } + + @Override + public EhrFolderDataRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrFolderDataRecord value2(Integer value) { + setNum(value); + return this; + } + + @Override + public EhrFolderDataRecord value3(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrFolderDataRecord value4(Integer value) { + setEhrFoldersIdx(value); + return this; + } + + @Override + public EhrFolderDataRecord value5(Integer value) { + setCitemNum(value); + return this; + } + + @Override + public EhrFolderDataRecord value6(String value) { + setRmEntity(value); + return this; + } + + @Override + public EhrFolderDataRecord value7(String value) { + setEntityConcept(value); + return this; + } + + @Override + public EhrFolderDataRecord value8(String value) { + setEntityName(value); + return this; + } + + @Override + public EhrFolderDataRecord value9(String value) { + setEntityAttribute(value); + return this; + } + + @Override + public EhrFolderDataRecord value10(String value) { + setEntityPath(value); + return this; + } + + @Override + public EhrFolderDataRecord value11(String value) { + setEntityPathCap(value); + return this; + } + + @Override + public EhrFolderDataRecord value12(String value) { + setEntityIdx(value); + return this; + } + + @Override + public EhrFolderDataRecord value13(String value) { + setEntityIdxCap(value); + return this; + } + + @Override + public EhrFolderDataRecord value14(Integer value) { + setEntityIdxLen(value); + return this; + } + + @Override + public EhrFolderDataRecord value15(JSONB value) { + setData(value); + return this; + } + + @Override + public EhrFolderDataRecord values( + UUID value1, + Integer value2, + UUID value3, + Integer value4, + Integer value5, + String value6, + String value7, + String value8, + String value9, + String value10, + String value11, + String value12, + String value13, + Integer value14, + JSONB value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrFolderDataRecord + */ + public EhrFolderDataRecord() { + super(EhrFolderData.EHR_FOLDER_DATA); + } + + /** + * Create a detached, initialised EhrFolderDataRecord + */ + public EhrFolderDataRecord( + UUID voId, + Integer num, + UUID ehrId, + Integer ehrFoldersIdx, + Integer citemNum, + String rmEntity, + String entityConcept, + String entityName, + String entityAttribute, + String entityPath, + String entityPathCap, + String entityIdx, + String entityIdxCap, + Integer entityIdxLen, + JSONB data) { + super(EhrFolderData.EHR_FOLDER_DATA); + + setVoId(voId); + setNum(num); + setEhrId(ehrId); + setEhrFoldersIdx(ehrFoldersIdx); + setCitemNum(citemNum); + setRmEntity(rmEntity); + setEntityConcept(entityConcept); + setEntityName(entityName); + setEntityAttribute(entityAttribute); + setEntityPath(entityPath); + setEntityPathCap(entityPathCap); + setEntityIdx(entityIdx); + setEntityIdxCap(entityIdxCap); + setEntityIdxLen(entityIdxLen); + setData(data); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionHistoryRecord.java new file mode 100644 index 0000000..5a51a27 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionHistoryRecord.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersionHistory; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Record9; +import org.jooq.Row9; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderVersionHistoryRecord extends UpdatableRecordImpl + implements Record9 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_folder_version_history.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_folder_version_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.ehr_folder_version_history.contribution_id. + */ + public void setContributionId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_folder_version_history.audit_id. + */ + public void setAuditId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.ehr_folder_version_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(4); + } + + /** + * Setter for ehr.ehr_folder_version_history.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(5); + } + + /** + * Setter for ehr.ehr_folder_version_history.ehr_folders_idx. + */ + public void setEhrFoldersIdx(Integer value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.ehr_folders_idx. + */ + public Integer getEhrFoldersIdx() { + return (Integer) get(6); + } + + /** + * Setter for ehr.ehr_folder_version_history.sys_period_upper. + */ + public void setSysPeriodUpper(OffsetDateTime value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.sys_period_upper. + */ + public OffsetDateTime getSysPeriodUpper() { + return (OffsetDateTime) get(7); + } + + /** + * Setter for ehr.ehr_folder_version_history.sys_deleted. + */ + public void setSysDeleted(Boolean value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_folder_version_history.sys_deleted. + */ + public Boolean getSysDeleted() { + return (Boolean) get(8); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record3 key() { + return (Record3) super.key(); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.VO_ID; + } + + @Override + public Field field2() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_ID; + } + + @Override + public Field field3() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.CONTRIBUTION_ID; + } + + @Override + public Field field4() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.AUDIT_ID; + } + + @Override + public Field field5() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.SYS_VERSION; + } + + @Override + public Field field6() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.SYS_PERIOD_LOWER; + } + + @Override + public Field field7() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.EHR_FOLDERS_IDX; + } + + @Override + public Field field8() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.SYS_PERIOD_UPPER; + } + + @Override + public Field field9() { + return EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY.SYS_DELETED; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getContributionId(); + } + + @Override + public UUID component4() { + return getAuditId(); + } + + @Override + public Integer component5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component6() { + return getSysPeriodLower(); + } + + @Override + public Integer component7() { + return getEhrFoldersIdx(); + } + + @Override + public OffsetDateTime component8() { + return getSysPeriodUpper(); + } + + @Override + public Boolean component9() { + return getSysDeleted(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getContributionId(); + } + + @Override + public UUID value4() { + return getAuditId(); + } + + @Override + public Integer value5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value6() { + return getSysPeriodLower(); + } + + @Override + public Integer value7() { + return getEhrFoldersIdx(); + } + + @Override + public OffsetDateTime value8() { + return getSysPeriodUpper(); + } + + @Override + public Boolean value9() { + return getSysDeleted(); + } + + @Override + public EhrFolderVersionHistoryRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value3(UUID value) { + setContributionId(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value4(UUID value) { + setAuditId(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value5(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value6(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value7(Integer value) { + setEhrFoldersIdx(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value8(OffsetDateTime value) { + setSysPeriodUpper(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord value9(Boolean value) { + setSysDeleted(value); + return this; + } + + @Override + public EhrFolderVersionHistoryRecord values( + UUID value1, + UUID value2, + UUID value3, + UUID value4, + Integer value5, + OffsetDateTime value6, + Integer value7, + OffsetDateTime value8, + Boolean value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrFolderVersionHistoryRecord + */ + public EhrFolderVersionHistoryRecord() { + super(EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY); + } + + /** + * Create a detached, initialised EhrFolderVersionHistoryRecord + */ + public EhrFolderVersionHistoryRecord( + UUID voId, + UUID ehrId, + UUID contributionId, + UUID auditId, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + Integer ehrFoldersIdx, + OffsetDateTime sysPeriodUpper, + Boolean sysDeleted) { + super(EhrFolderVersionHistory.EHR_FOLDER_VERSION_HISTORY); + + setVoId(voId); + setEhrId(ehrId); + setContributionId(contributionId); + setAuditId(auditId); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setEhrFoldersIdx(ehrFoldersIdx); + setSysPeriodUpper(sysPeriodUpper); + setSysDeleted(sysDeleted); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionRecord.java new file mode 100644 index 0000000..b7300df --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrFolderVersionRecord.java @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrFolderVersion; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrFolderVersionRecord extends UpdatableRecordImpl + implements Record7 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_folder_version.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_folder_version.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_folder_version.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_folder_version.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.ehr_folder_version.contribution_id. + */ + public void setContributionId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_folder_version.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_folder_version.audit_id. + */ + public void setAuditId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_folder_version.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.ehr_folder_version.sys_version. + */ + public void setSysVersion(Integer value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_folder_version.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(4); + } + + /** + * Setter for ehr.ehr_folder_version.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_folder_version.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(5); + } + + /** + * Setter for ehr.ehr_folder_version.ehr_folders_idx. + */ + public void setEhrFoldersIdx(Integer value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_folder_version.ehr_folders_idx. + */ + public Integer getEhrFoldersIdx() { + return (Integer) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrFolderVersion.EHR_FOLDER_VERSION.VO_ID; + } + + @Override + public Field field2() { + return EhrFolderVersion.EHR_FOLDER_VERSION.EHR_ID; + } + + @Override + public Field field3() { + return EhrFolderVersion.EHR_FOLDER_VERSION.CONTRIBUTION_ID; + } + + @Override + public Field field4() { + return EhrFolderVersion.EHR_FOLDER_VERSION.AUDIT_ID; + } + + @Override + public Field field5() { + return EhrFolderVersion.EHR_FOLDER_VERSION.SYS_VERSION; + } + + @Override + public Field field6() { + return EhrFolderVersion.EHR_FOLDER_VERSION.SYS_PERIOD_LOWER; + } + + @Override + public Field field7() { + return EhrFolderVersion.EHR_FOLDER_VERSION.EHR_FOLDERS_IDX; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getContributionId(); + } + + @Override + public UUID component4() { + return getAuditId(); + } + + @Override + public Integer component5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component6() { + return getSysPeriodLower(); + } + + @Override + public Integer component7() { + return getEhrFoldersIdx(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getContributionId(); + } + + @Override + public UUID value4() { + return getAuditId(); + } + + @Override + public Integer value5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value6() { + return getSysPeriodLower(); + } + + @Override + public Integer value7() { + return getEhrFoldersIdx(); + } + + @Override + public EhrFolderVersionRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrFolderVersionRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrFolderVersionRecord value3(UUID value) { + setContributionId(value); + return this; + } + + @Override + public EhrFolderVersionRecord value4(UUID value) { + setAuditId(value); + return this; + } + + @Override + public EhrFolderVersionRecord value5(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrFolderVersionRecord value6(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public EhrFolderVersionRecord value7(Integer value) { + setEhrFoldersIdx(value); + return this; + } + + @Override + public EhrFolderVersionRecord values( + UUID value1, UUID value2, UUID value3, UUID value4, Integer value5, OffsetDateTime value6, Integer value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrFolderVersionRecord + */ + public EhrFolderVersionRecord() { + super(EhrFolderVersion.EHR_FOLDER_VERSION); + } + + /** + * Create a detached, initialised EhrFolderVersionRecord + */ + public EhrFolderVersionRecord( + UUID voId, + UUID ehrId, + UUID contributionId, + UUID auditId, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + Integer ehrFoldersIdx) { + super(EhrFolderVersion.EHR_FOLDER_VERSION); + + setVoId(voId); + setEhrId(ehrId); + setContributionId(contributionId); + setAuditId(auditId); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setEhrFoldersIdx(ehrFoldersIdx); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrRecord.java new file mode 100644 index 0000000..4fe0ad2 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrRecord.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Ehr; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr.creation_date. + */ + public void setCreationDate(OffsetDateTime value) { + set(1, value); + } + + /** + * Getter for ehr.ehr.creation_date. + */ + public OffsetDateTime getCreationDate() { + return (OffsetDateTime) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return Ehr.EHR_.ID; + } + + @Override + public Field field2() { + return Ehr.EHR_.CREATION_DATE; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public OffsetDateTime component2() { + return getCreationDate(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public OffsetDateTime value2() { + return getCreationDate(); + } + + @Override + public EhrRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public EhrRecord value2(OffsetDateTime value) { + setCreationDate(value); + return this; + } + + @Override + public EhrRecord values(UUID value1, OffsetDateTime value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrRecord + */ + public EhrRecord() { + super(Ehr.EHR_); + } + + /** + * Create a detached, initialised EhrRecord + */ + public EhrRecord(UUID id, OffsetDateTime creationDate) { + super(Ehr.EHR_); + + setId(id); + setCreationDate(creationDate); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataHistoryRecord.java new file mode 100644 index 0000000..244f3c8 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataHistoryRecord.java @@ -0,0 +1,717 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusDataHistory; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record15; +import org.jooq.Record3; +import org.jooq.Row15; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusDataHistoryRecord extends UpdatableRecordImpl + implements Record15< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_status_data_history.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_status_data_history.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_status_data_history.num. + */ + public void setNum(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_status_data_history.num. + */ + public Integer getNum() { + return (Integer) get(1); + } + + /** + * Setter for ehr.ehr_status_data_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_status_data_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_status_data_history.citem_num. + */ + public void setCitemNum(Integer value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_status_data_history.citem_num. + */ + public Integer getCitemNum() { + return (Integer) get(3); + } + + /** + * Setter for ehr.ehr_status_data_history.rm_entity. + */ + public void setRmEntity(String value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_status_data_history.rm_entity. + */ + public String getRmEntity() { + return (String) get(4); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_concept. + */ + public void setEntityConcept(String value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_concept. + */ + public String getEntityConcept() { + return (String) get(5); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_name. + */ + public void setEntityName(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_name. + */ + public String getEntityName() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_attribute. + */ + public void setEntityAttribute(String value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_attribute. + */ + public String getEntityAttribute() { + return (String) get(7); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_path. + */ + public void setEntityPath(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_path. + */ + public String getEntityPath() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_path_cap. + */ + public void setEntityPathCap(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_path_cap. + */ + public String getEntityPathCap() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_idx. + */ + public void setEntityIdx(String value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_idx. + */ + public String getEntityIdx() { + return (String) get(10); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_idx_cap. + */ + public void setEntityIdxCap(String value) { + set(11, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_idx_cap. + */ + public String getEntityIdxCap() { + return (String) get(11); + } + + /** + * Setter for ehr.ehr_status_data_history.entity_idx_len. + */ + public void setEntityIdxLen(Integer value) { + set(12, value); + } + + /** + * Getter for ehr.ehr_status_data_history.entity_idx_len. + */ + public Integer getEntityIdxLen() { + return (Integer) get(12); + } + + /** + * Setter for ehr.ehr_status_data_history.data. + */ + public void setData(JSONB value) { + set(13, value); + } + + /** + * Getter for ehr.ehr_status_data_history.data. + */ + public JSONB getData() { + return (JSONB) get(13); + } + + /** + * Setter for ehr.ehr_status_data_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(14, value); + } + + /** + * Getter for ehr.ehr_status_data_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(14); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record3 key() { + return (Record3) super.key(); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row15< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB, + Integer> + valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.VO_ID; + } + + @Override + public Field field2() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.NUM; + } + + @Override + public Field field3() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.EHR_ID; + } + + @Override + public Field field4() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.CITEM_NUM; + } + + @Override + public Field field5() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.RM_ENTITY; + } + + @Override + public Field field6() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_CONCEPT; + } + + @Override + public Field field7() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_NAME; + } + + @Override + public Field field8() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_ATTRIBUTE; + } + + @Override + public Field field9() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_PATH; + } + + @Override + public Field field10() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_PATH_CAP; + } + + @Override + public Field field11() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_IDX; + } + + @Override + public Field field12() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_IDX_CAP; + } + + @Override + public Field field13() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.ENTITY_IDX_LEN; + } + + @Override + public Field field14() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.DATA; + } + + @Override + public Field field15() { + return EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY.SYS_VERSION; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public Integer component2() { + return getNum(); + } + + @Override + public UUID component3() { + return getEhrId(); + } + + @Override + public Integer component4() { + return getCitemNum(); + } + + @Override + public String component5() { + return getRmEntity(); + } + + @Override + public String component6() { + return getEntityConcept(); + } + + @Override + public String component7() { + return getEntityName(); + } + + @Override + public String component8() { + return getEntityAttribute(); + } + + @Override + public String component9() { + return getEntityPath(); + } + + @Override + public String component10() { + return getEntityPathCap(); + } + + @Override + public String component11() { + return getEntityIdx(); + } + + @Override + public String component12() { + return getEntityIdxCap(); + } + + @Override + public Integer component13() { + return getEntityIdxLen(); + } + + @Override + public JSONB component14() { + return getData(); + } + + @Override + public Integer component15() { + return getSysVersion(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public Integer value2() { + return getNum(); + } + + @Override + public UUID value3() { + return getEhrId(); + } + + @Override + public Integer value4() { + return getCitemNum(); + } + + @Override + public String value5() { + return getRmEntity(); + } + + @Override + public String value6() { + return getEntityConcept(); + } + + @Override + public String value7() { + return getEntityName(); + } + + @Override + public String value8() { + return getEntityAttribute(); + } + + @Override + public String value9() { + return getEntityPath(); + } + + @Override + public String value10() { + return getEntityPathCap(); + } + + @Override + public String value11() { + return getEntityIdx(); + } + + @Override + public String value12() { + return getEntityIdxCap(); + } + + @Override + public Integer value13() { + return getEntityIdxLen(); + } + + @Override + public JSONB value14() { + return getData(); + } + + @Override + public Integer value15() { + return getSysVersion(); + } + + @Override + public EhrStatusDataHistoryRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value2(Integer value) { + setNum(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value3(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value4(Integer value) { + setCitemNum(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value5(String value) { + setRmEntity(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value6(String value) { + setEntityConcept(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value7(String value) { + setEntityName(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value8(String value) { + setEntityAttribute(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value9(String value) { + setEntityPath(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value10(String value) { + setEntityPathCap(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value11(String value) { + setEntityIdx(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value12(String value) { + setEntityIdxCap(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value13(Integer value) { + setEntityIdxLen(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value14(JSONB value) { + setData(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord value15(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrStatusDataHistoryRecord values( + UUID value1, + Integer value2, + UUID value3, + Integer value4, + String value5, + String value6, + String value7, + String value8, + String value9, + String value10, + String value11, + String value12, + Integer value13, + JSONB value14, + Integer value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrStatusDataHistoryRecord + */ + public EhrStatusDataHistoryRecord() { + super(EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY); + } + + /** + * Create a detached, initialised EhrStatusDataHistoryRecord + */ + public EhrStatusDataHistoryRecord( + UUID voId, + Integer num, + UUID ehrId, + Integer citemNum, + String rmEntity, + String entityConcept, + String entityName, + String entityAttribute, + String entityPath, + String entityPathCap, + String entityIdx, + String entityIdxCap, + Integer entityIdxLen, + JSONB data, + Integer sysVersion) { + super(EhrStatusDataHistory.EHR_STATUS_DATA_HISTORY); + + setVoId(voId); + setNum(num); + setEhrId(ehrId); + setCitemNum(citemNum); + setRmEntity(rmEntity); + setEntityConcept(entityConcept); + setEntityName(entityName); + setEntityAttribute(entityAttribute); + setEntityPath(entityPath); + setEntityPathCap(entityPathCap); + setEntityIdx(entityIdx); + setEntityIdxCap(entityIdxCap); + setEntityIdxLen(entityIdxLen); + setData(data); + setSysVersion(sysVersion); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataRecord.java new file mode 100644 index 0000000..56d076a --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusDataRecord.java @@ -0,0 +1,675 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusData; +import org.jooq.Field; +import org.jooq.JSONB; +import org.jooq.Record14; +import org.jooq.Record2; +import org.jooq.Row14; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusDataRecord extends UpdatableRecordImpl + implements Record14< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_status_data.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_status_data.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_status_data.num. + */ + public void setNum(Integer value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_status_data.num. + */ + public Integer getNum() { + return (Integer) get(1); + } + + /** + * Setter for ehr.ehr_status_data.ehr_id. + */ + public void setEhrId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_status_data.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_status_data.citem_num. + */ + public void setCitemNum(Integer value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_status_data.citem_num. + */ + public Integer getCitemNum() { + return (Integer) get(3); + } + + /** + * Setter for ehr.ehr_status_data.rm_entity. + */ + public void setRmEntity(String value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_status_data.rm_entity. + */ + public String getRmEntity() { + return (String) get(4); + } + + /** + * Setter for ehr.ehr_status_data.entity_concept. + */ + public void setEntityConcept(String value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_concept. + */ + public String getEntityConcept() { + return (String) get(5); + } + + /** + * Setter for ehr.ehr_status_data.entity_name. + */ + public void setEntityName(String value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_name. + */ + public String getEntityName() { + return (String) get(6); + } + + /** + * Setter for ehr.ehr_status_data.entity_attribute. + */ + public void setEntityAttribute(String value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_attribute. + */ + public String getEntityAttribute() { + return (String) get(7); + } + + /** + * Setter for ehr.ehr_status_data.entity_path. + */ + public void setEntityPath(String value) { + set(8, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_path. + */ + public String getEntityPath() { + return (String) get(8); + } + + /** + * Setter for ehr.ehr_status_data.entity_path_cap. + */ + public void setEntityPathCap(String value) { + set(9, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_path_cap. + */ + public String getEntityPathCap() { + return (String) get(9); + } + + /** + * Setter for ehr.ehr_status_data.entity_idx. + */ + public void setEntityIdx(String value) { + set(10, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_idx. + */ + public String getEntityIdx() { + return (String) get(10); + } + + /** + * Setter for ehr.ehr_status_data.entity_idx_cap. + */ + public void setEntityIdxCap(String value) { + set(11, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_idx_cap. + */ + public String getEntityIdxCap() { + return (String) get(11); + } + + /** + * Setter for ehr.ehr_status_data.entity_idx_len. + */ + public void setEntityIdxLen(Integer value) { + set(12, value); + } + + /** + * Getter for ehr.ehr_status_data.entity_idx_len. + */ + public Integer getEntityIdxLen() { + return (Integer) get(12); + } + + /** + * Setter for ehr.ehr_status_data.data. + */ + public void setData(JSONB value) { + set(13, value); + } + + /** + * Getter for ehr.ehr_status_data.data. + */ + public JSONB getData() { + return (JSONB) get(13); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record14 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row14< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> + fieldsRow() { + return (Row14) super.fieldsRow(); + } + + @Override + public Row14< + UUID, + Integer, + UUID, + Integer, + String, + String, + String, + String, + String, + String, + String, + String, + Integer, + JSONB> + valuesRow() { + return (Row14) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrStatusData.EHR_STATUS_DATA.VO_ID; + } + + @Override + public Field field2() { + return EhrStatusData.EHR_STATUS_DATA.NUM; + } + + @Override + public Field field3() { + return EhrStatusData.EHR_STATUS_DATA.EHR_ID; + } + + @Override + public Field field4() { + return EhrStatusData.EHR_STATUS_DATA.CITEM_NUM; + } + + @Override + public Field field5() { + return EhrStatusData.EHR_STATUS_DATA.RM_ENTITY; + } + + @Override + public Field field6() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_CONCEPT; + } + + @Override + public Field field7() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_NAME; + } + + @Override + public Field field8() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_ATTRIBUTE; + } + + @Override + public Field field9() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_PATH; + } + + @Override + public Field field10() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_PATH_CAP; + } + + @Override + public Field field11() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_IDX; + } + + @Override + public Field field12() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_IDX_CAP; + } + + @Override + public Field field13() { + return EhrStatusData.EHR_STATUS_DATA.ENTITY_IDX_LEN; + } + + @Override + public Field field14() { + return EhrStatusData.EHR_STATUS_DATA.DATA; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public Integer component2() { + return getNum(); + } + + @Override + public UUID component3() { + return getEhrId(); + } + + @Override + public Integer component4() { + return getCitemNum(); + } + + @Override + public String component5() { + return getRmEntity(); + } + + @Override + public String component6() { + return getEntityConcept(); + } + + @Override + public String component7() { + return getEntityName(); + } + + @Override + public String component8() { + return getEntityAttribute(); + } + + @Override + public String component9() { + return getEntityPath(); + } + + @Override + public String component10() { + return getEntityPathCap(); + } + + @Override + public String component11() { + return getEntityIdx(); + } + + @Override + public String component12() { + return getEntityIdxCap(); + } + + @Override + public Integer component13() { + return getEntityIdxLen(); + } + + @Override + public JSONB component14() { + return getData(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public Integer value2() { + return getNum(); + } + + @Override + public UUID value3() { + return getEhrId(); + } + + @Override + public Integer value4() { + return getCitemNum(); + } + + @Override + public String value5() { + return getRmEntity(); + } + + @Override + public String value6() { + return getEntityConcept(); + } + + @Override + public String value7() { + return getEntityName(); + } + + @Override + public String value8() { + return getEntityAttribute(); + } + + @Override + public String value9() { + return getEntityPath(); + } + + @Override + public String value10() { + return getEntityPathCap(); + } + + @Override + public String value11() { + return getEntityIdx(); + } + + @Override + public String value12() { + return getEntityIdxCap(); + } + + @Override + public Integer value13() { + return getEntityIdxLen(); + } + + @Override + public JSONB value14() { + return getData(); + } + + @Override + public EhrStatusDataRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrStatusDataRecord value2(Integer value) { + setNum(value); + return this; + } + + @Override + public EhrStatusDataRecord value3(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrStatusDataRecord value4(Integer value) { + setCitemNum(value); + return this; + } + + @Override + public EhrStatusDataRecord value5(String value) { + setRmEntity(value); + return this; + } + + @Override + public EhrStatusDataRecord value6(String value) { + setEntityConcept(value); + return this; + } + + @Override + public EhrStatusDataRecord value7(String value) { + setEntityName(value); + return this; + } + + @Override + public EhrStatusDataRecord value8(String value) { + setEntityAttribute(value); + return this; + } + + @Override + public EhrStatusDataRecord value9(String value) { + setEntityPath(value); + return this; + } + + @Override + public EhrStatusDataRecord value10(String value) { + setEntityPathCap(value); + return this; + } + + @Override + public EhrStatusDataRecord value11(String value) { + setEntityIdx(value); + return this; + } + + @Override + public EhrStatusDataRecord value12(String value) { + setEntityIdxCap(value); + return this; + } + + @Override + public EhrStatusDataRecord value13(Integer value) { + setEntityIdxLen(value); + return this; + } + + @Override + public EhrStatusDataRecord value14(JSONB value) { + setData(value); + return this; + } + + @Override + public EhrStatusDataRecord values( + UUID value1, + Integer value2, + UUID value3, + Integer value4, + String value5, + String value6, + String value7, + String value8, + String value9, + String value10, + String value11, + String value12, + Integer value13, + JSONB value14) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrStatusDataRecord + */ + public EhrStatusDataRecord() { + super(EhrStatusData.EHR_STATUS_DATA); + } + + /** + * Create a detached, initialised EhrStatusDataRecord + */ + public EhrStatusDataRecord( + UUID voId, + Integer num, + UUID ehrId, + Integer citemNum, + String rmEntity, + String entityConcept, + String entityName, + String entityAttribute, + String entityPath, + String entityPathCap, + String entityIdx, + String entityIdxCap, + Integer entityIdxLen, + JSONB data) { + super(EhrStatusData.EHR_STATUS_DATA); + + setVoId(voId); + setNum(num); + setEhrId(ehrId); + setCitemNum(citemNum); + setRmEntity(rmEntity); + setEntityConcept(entityConcept); + setEntityName(entityName); + setEntityAttribute(entityAttribute); + setEntityPath(entityPath); + setEntityPathCap(entityPathCap); + setEntityIdx(entityIdx); + setEntityIdxCap(entityIdxCap); + setEntityIdxLen(entityIdxLen); + setData(data); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionHistoryRecord.java new file mode 100644 index 0000000..a930f0f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionHistoryRecord.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersionHistory; +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Record8; +import org.jooq.Row8; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusVersionHistoryRecord extends UpdatableRecordImpl + implements Record8 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_status_version_history.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_status_version_history.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_status_version_history.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_status_version_history.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.ehr_status_version_history.contribution_id. + */ + public void setContributionId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_status_version_history.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_status_version_history.audit_id. + */ + public void setAuditId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_status_version_history.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.ehr_status_version_history.sys_version. + */ + public void setSysVersion(Integer value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_status_version_history.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(4); + } + + /** + * Setter for ehr.ehr_status_version_history.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_status_version_history.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(5); + } + + /** + * Setter for ehr.ehr_status_version_history.sys_period_upper. + */ + public void setSysPeriodUpper(OffsetDateTime value) { + set(6, value); + } + + /** + * Getter for ehr.ehr_status_version_history.sys_period_upper. + */ + public OffsetDateTime getSysPeriodUpper() { + return (OffsetDateTime) get(6); + } + + /** + * Setter for ehr.ehr_status_version_history.sys_deleted. + */ + public void setSysDeleted(Boolean value) { + set(7, value); + } + + /** + * Getter for ehr.ehr_status_version_history.sys_deleted. + */ + public Boolean getSysDeleted() { + return (Boolean) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.VO_ID; + } + + @Override + public Field field2() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.EHR_ID; + } + + @Override + public Field field3() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.CONTRIBUTION_ID; + } + + @Override + public Field field4() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.AUDIT_ID; + } + + @Override + public Field field5() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.SYS_VERSION; + } + + @Override + public Field field6() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.SYS_PERIOD_LOWER; + } + + @Override + public Field field7() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.SYS_PERIOD_UPPER; + } + + @Override + public Field field8() { + return EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY.SYS_DELETED; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getContributionId(); + } + + @Override + public UUID component4() { + return getAuditId(); + } + + @Override + public Integer component5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component6() { + return getSysPeriodLower(); + } + + @Override + public OffsetDateTime component7() { + return getSysPeriodUpper(); + } + + @Override + public Boolean component8() { + return getSysDeleted(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getContributionId(); + } + + @Override + public UUID value4() { + return getAuditId(); + } + + @Override + public Integer value5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value6() { + return getSysPeriodLower(); + } + + @Override + public OffsetDateTime value7() { + return getSysPeriodUpper(); + } + + @Override + public Boolean value8() { + return getSysDeleted(); + } + + @Override + public EhrStatusVersionHistoryRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value3(UUID value) { + setContributionId(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value4(UUID value) { + setAuditId(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value5(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value6(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value7(OffsetDateTime value) { + setSysPeriodUpper(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord value8(Boolean value) { + setSysDeleted(value); + return this; + } + + @Override + public EhrStatusVersionHistoryRecord values( + UUID value1, + UUID value2, + UUID value3, + UUID value4, + Integer value5, + OffsetDateTime value6, + OffsetDateTime value7, + Boolean value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrStatusVersionHistoryRecord + */ + public EhrStatusVersionHistoryRecord() { + super(EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY); + } + + /** + * Create a detached, initialised EhrStatusVersionHistoryRecord + */ + public EhrStatusVersionHistoryRecord( + UUID voId, + UUID ehrId, + UUID contributionId, + UUID auditId, + Integer sysVersion, + OffsetDateTime sysPeriodLower, + OffsetDateTime sysPeriodUpper, + Boolean sysDeleted) { + super(EhrStatusVersionHistory.EHR_STATUS_VERSION_HISTORY); + + setVoId(voId); + setEhrId(ehrId); + setContributionId(contributionId); + setAuditId(auditId); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + setSysPeriodUpper(sysPeriodUpper); + setSysDeleted(sysDeleted); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionRecord.java new file mode 100644 index 0000000..540c9be --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/EhrStatusVersionRecord.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.EhrStatusVersion; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class EhrStatusVersionRecord extends UpdatableRecordImpl + implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.ehr_status_version.vo_id. + */ + public void setVoId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.ehr_status_version.vo_id. + */ + public UUID getVoId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.ehr_status_version.ehr_id. + */ + public void setEhrId(UUID value) { + set(1, value); + } + + /** + * Getter for ehr.ehr_status_version.ehr_id. + */ + public UUID getEhrId() { + return (UUID) get(1); + } + + /** + * Setter for ehr.ehr_status_version.contribution_id. + */ + public void setContributionId(UUID value) { + set(2, value); + } + + /** + * Getter for ehr.ehr_status_version.contribution_id. + */ + public UUID getContributionId() { + return (UUID) get(2); + } + + /** + * Setter for ehr.ehr_status_version.audit_id. + */ + public void setAuditId(UUID value) { + set(3, value); + } + + /** + * Getter for ehr.ehr_status_version.audit_id. + */ + public UUID getAuditId() { + return (UUID) get(3); + } + + /** + * Setter for ehr.ehr_status_version.sys_version. + */ + public void setSysVersion(Integer value) { + set(4, value); + } + + /** + * Getter for ehr.ehr_status_version.sys_version. + */ + public Integer getSysVersion() { + return (Integer) get(4); + } + + /** + * Setter for ehr.ehr_status_version.sys_period_lower. + */ + public void setSysPeriodLower(OffsetDateTime value) { + set(5, value); + } + + /** + * Getter for ehr.ehr_status_version.sys_period_lower. + */ + public OffsetDateTime getSysPeriodLower() { + return (OffsetDateTime) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return EhrStatusVersion.EHR_STATUS_VERSION.VO_ID; + } + + @Override + public Field field2() { + return EhrStatusVersion.EHR_STATUS_VERSION.EHR_ID; + } + + @Override + public Field field3() { + return EhrStatusVersion.EHR_STATUS_VERSION.CONTRIBUTION_ID; + } + + @Override + public Field field4() { + return EhrStatusVersion.EHR_STATUS_VERSION.AUDIT_ID; + } + + @Override + public Field field5() { + return EhrStatusVersion.EHR_STATUS_VERSION.SYS_VERSION; + } + + @Override + public Field field6() { + return EhrStatusVersion.EHR_STATUS_VERSION.SYS_PERIOD_LOWER; + } + + @Override + public UUID component1() { + return getVoId(); + } + + @Override + public UUID component2() { + return getEhrId(); + } + + @Override + public UUID component3() { + return getContributionId(); + } + + @Override + public UUID component4() { + return getAuditId(); + } + + @Override + public Integer component5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime component6() { + return getSysPeriodLower(); + } + + @Override + public UUID value1() { + return getVoId(); + } + + @Override + public UUID value2() { + return getEhrId(); + } + + @Override + public UUID value3() { + return getContributionId(); + } + + @Override + public UUID value4() { + return getAuditId(); + } + + @Override + public Integer value5() { + return getSysVersion(); + } + + @Override + public OffsetDateTime value6() { + return getSysPeriodLower(); + } + + @Override + public EhrStatusVersionRecord value1(UUID value) { + setVoId(value); + return this; + } + + @Override + public EhrStatusVersionRecord value2(UUID value) { + setEhrId(value); + return this; + } + + @Override + public EhrStatusVersionRecord value3(UUID value) { + setContributionId(value); + return this; + } + + @Override + public EhrStatusVersionRecord value4(UUID value) { + setAuditId(value); + return this; + } + + @Override + public EhrStatusVersionRecord value5(Integer value) { + setSysVersion(value); + return this; + } + + @Override + public EhrStatusVersionRecord value6(OffsetDateTime value) { + setSysPeriodLower(value); + return this; + } + + @Override + public EhrStatusVersionRecord values( + UUID value1, UUID value2, UUID value3, UUID value4, Integer value5, OffsetDateTime value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached EhrStatusVersionRecord + */ + public EhrStatusVersionRecord() { + super(EhrStatusVersion.EHR_STATUS_VERSION); + } + + /** + * Create a detached, initialised EhrStatusVersionRecord + */ + public EhrStatusVersionRecord( + UUID voId, + UUID ehrId, + UUID contributionId, + UUID auditId, + Integer sysVersion, + OffsetDateTime sysPeriodLower) { + super(EhrStatusVersion.EHR_STATUS_VERSION); + + setVoId(voId); + setEhrId(ehrId); + setContributionId(contributionId); + setAuditId(auditId); + setSysVersion(sysVersion); + setSysPeriodLower(sysPeriodLower); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java new file mode 100644 index 0000000..890927f --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/FlywaySchemaHistoryRecord.java @@ -0,0 +1,476 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.LocalDateTime; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.FlywaySchemaHistory; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record10; +import org.jooq.Row10; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class FlywaySchemaHistoryRecord extends UpdatableRecordImpl + implements Record10 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.flyway_schema_history.installed_rank. + */ + public void setInstalledRank(Integer value) { + set(0, value); + } + + /** + * Getter for ehr.flyway_schema_history.installed_rank. + */ + public Integer getInstalledRank() { + return (Integer) get(0); + } + + /** + * Setter for ehr.flyway_schema_history.version. + */ + public void setVersion(String value) { + set(1, value); + } + + /** + * Getter for ehr.flyway_schema_history.version. + */ + public String getVersion() { + return (String) get(1); + } + + /** + * Setter for ehr.flyway_schema_history.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for ehr.flyway_schema_history.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for ehr.flyway_schema_history.type. + */ + public void setType(String value) { + set(3, value); + } + + /** + * Getter for ehr.flyway_schema_history.type. + */ + public String getType() { + return (String) get(3); + } + + /** + * Setter for ehr.flyway_schema_history.script. + */ + public void setScript(String value) { + set(4, value); + } + + /** + * Getter for ehr.flyway_schema_history.script. + */ + public String getScript() { + return (String) get(4); + } + + /** + * Setter for ehr.flyway_schema_history.checksum. + */ + public void setChecksum(Integer value) { + set(5, value); + } + + /** + * Getter for ehr.flyway_schema_history.checksum. + */ + public Integer getChecksum() { + return (Integer) get(5); + } + + /** + * Setter for ehr.flyway_schema_history.installed_by. + */ + public void setInstalledBy(String value) { + set(6, value); + } + + /** + * Getter for ehr.flyway_schema_history.installed_by. + */ + public String getInstalledBy() { + return (String) get(6); + } + + /** + * Setter for ehr.flyway_schema_history.installed_on. + */ + public void setInstalledOn(LocalDateTime value) { + set(7, value); + } + + /** + * Getter for ehr.flyway_schema_history.installed_on. + */ + public LocalDateTime getInstalledOn() { + return (LocalDateTime) get(7); + } + + /** + * Setter for ehr.flyway_schema_history.execution_time. + */ + public void setExecutionTime(Integer value) { + set(8, value); + } + + /** + * Getter for ehr.flyway_schema_history.execution_time. + */ + public Integer getExecutionTime() { + return (Integer) get(8); + } + + /** + * Setter for ehr.flyway_schema_history.success. + */ + public void setSuccess(Boolean value) { + set(9, value); + } + + /** + * Getter for ehr.flyway_schema_history.success. + */ + public Boolean getSuccess() { + return (Boolean) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row10 + fieldsRow() { + return (Row10) super.fieldsRow(); + } + + @Override + public Row10 + valuesRow() { + return (Row10) super.valuesRow(); + } + + @Override + public Field field1() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_RANK; + } + + @Override + public Field field2() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.VERSION; + } + + @Override + public Field field3() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.DESCRIPTION; + } + + @Override + public Field field4() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.TYPE; + } + + @Override + public Field field5() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SCRIPT; + } + + @Override + public Field field6() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.CHECKSUM; + } + + @Override + public Field field7() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_BY; + } + + @Override + public Field field8() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_ON; + } + + @Override + public Field field9() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.EXECUTION_TIME; + } + + @Override + public Field field10() { + return FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SUCCESS; + } + + @Override + public Integer component1() { + return getInstalledRank(); + } + + @Override + public String component2() { + return getVersion(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public String component4() { + return getType(); + } + + @Override + public String component5() { + return getScript(); + } + + @Override + public Integer component6() { + return getChecksum(); + } + + @Override + public String component7() { + return getInstalledBy(); + } + + @Override + public LocalDateTime component8() { + return getInstalledOn(); + } + + @Override + public Integer component9() { + return getExecutionTime(); + } + + @Override + public Boolean component10() { + return getSuccess(); + } + + @Override + public Integer value1() { + return getInstalledRank(); + } + + @Override + public String value2() { + return getVersion(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public String value4() { + return getType(); + } + + @Override + public String value5() { + return getScript(); + } + + @Override + public Integer value6() { + return getChecksum(); + } + + @Override + public String value7() { + return getInstalledBy(); + } + + @Override + public LocalDateTime value8() { + return getInstalledOn(); + } + + @Override + public Integer value9() { + return getExecutionTime(); + } + + @Override + public Boolean value10() { + return getSuccess(); + } + + @Override + public FlywaySchemaHistoryRecord value1(Integer value) { + setInstalledRank(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value2(String value) { + setVersion(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value4(String value) { + setType(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value5(String value) { + setScript(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value6(Integer value) { + setChecksum(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value7(String value) { + setInstalledBy(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value8(LocalDateTime value) { + setInstalledOn(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value9(Integer value) { + setExecutionTime(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord value10(Boolean value) { + setSuccess(value); + return this; + } + + @Override + public FlywaySchemaHistoryRecord values( + Integer value1, + String value2, + String value3, + String value4, + String value5, + Integer value6, + String value7, + LocalDateTime value8, + Integer value9, + Boolean value10) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached FlywaySchemaHistoryRecord + */ + public FlywaySchemaHistoryRecord() { + super(FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY); + } + + /** + * Create a detached, initialised FlywaySchemaHistoryRecord + */ + public FlywaySchemaHistoryRecord( + Integer installedRank, + String version, + String description, + String type, + String script, + Integer checksum, + String installedBy, + LocalDateTime installedOn, + Integer executionTime, + Boolean success) { + super(FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY); + + setInstalledRank(installedRank); + setVersion(version); + setDescription(description); + setType(type); + setScript(script); + setChecksum(checksum); + setInstalledBy(installedBy); + setInstalledOn(installedOn); + setExecutionTime(executionTime); + setSuccess(success); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/PluginRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/PluginRecord.java new file mode 100644 index 0000000..13a0427 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/PluginRecord.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Plugin; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * key value store for plugin sub system + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class PluginRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.plugin.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.plugin.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.plugin.pluginid. + */ + public void setPluginid(String value) { + set(1, value); + } + + /** + * Getter for ehr.plugin.pluginid. + */ + public String getPluginid() { + return (String) get(1); + } + + /** + * Setter for ehr.plugin.key. + */ + public void setKey(String value) { + set(2, value); + } + + /** + * Getter for ehr.plugin.key. + */ + public String getKey() { + return (String) get(2); + } + + /** + * Setter for ehr.plugin.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for ehr.plugin.value. + */ + public String getValue() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return Plugin.PLUGIN.ID; + } + + @Override + public Field field2() { + return Plugin.PLUGIN.PLUGINID; + } + + @Override + public Field field3() { + return Plugin.PLUGIN.KEY; + } + + @Override + public Field field4() { + return Plugin.PLUGIN.VALUE; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getPluginid(); + } + + @Override + public String component3() { + return getKey(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getPluginid(); + } + + @Override + public String value3() { + return getKey(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public PluginRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public PluginRecord value2(String value) { + setPluginid(value); + return this; + } + + @Override + public PluginRecord value3(String value) { + setKey(value); + return this; + } + + @Override + public PluginRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public PluginRecord values(UUID value1, String value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PluginRecord + */ + public PluginRecord() { + super(Plugin.PLUGIN); + } + + /** + * Create a detached, initialised PluginRecord + */ + public PluginRecord(UUID id, String pluginid, String key, String value) { + super(Plugin.PLUGIN); + + setId(id); + setPluginid(pluginid); + setKey(key); + setValue(value); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/StoredQueryRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/StoredQueryRecord.java new file mode 100644 index 0000000..4d5c9c6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/StoredQueryRecord.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.StoredQuery; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class StoredQueryRecord extends UpdatableRecordImpl + implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.stored_query.reverse_domain_name. + */ + public void setReverseDomainName(String value) { + set(0, value); + } + + /** + * Getter for ehr.stored_query.reverse_domain_name. + */ + public String getReverseDomainName() { + return (String) get(0); + } + + /** + * Setter for ehr.stored_query.semantic_id. + */ + public void setSemanticId(String value) { + set(1, value); + } + + /** + * Getter for ehr.stored_query.semantic_id. + */ + public String getSemanticId() { + return (String) get(1); + } + + /** + * Setter for ehr.stored_query.semver. + */ + public void setSemver(String value) { + set(2, value); + } + + /** + * Getter for ehr.stored_query.semver. + */ + public String getSemver() { + return (String) get(2); + } + + /** + * Setter for ehr.stored_query.query_text. + */ + public void setQueryText(String value) { + set(3, value); + } + + /** + * Getter for ehr.stored_query.query_text. + */ + public String getQueryText() { + return (String) get(3); + } + + /** + * Setter for ehr.stored_query.type. + */ + public void setType(String value) { + set(4, value); + } + + /** + * Getter for ehr.stored_query.type. + */ + public String getType() { + return (String) get(4); + } + + /** + * Setter for ehr.stored_query.creation_date. + */ + public void setCreationDate(OffsetDateTime value) { + set(5, value); + } + + /** + * Getter for ehr.stored_query.creation_date. + */ + public OffsetDateTime getCreationDate() { + return (OffsetDateTime) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record3 key() { + return (Record3) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return StoredQuery.STORED_QUERY.REVERSE_DOMAIN_NAME; + } + + @Override + public Field field2() { + return StoredQuery.STORED_QUERY.SEMANTIC_ID; + } + + @Override + public Field field3() { + return StoredQuery.STORED_QUERY.SEMVER; + } + + @Override + public Field field4() { + return StoredQuery.STORED_QUERY.QUERY_TEXT; + } + + @Override + public Field field5() { + return StoredQuery.STORED_QUERY.TYPE; + } + + @Override + public Field field6() { + return StoredQuery.STORED_QUERY.CREATION_DATE; + } + + @Override + public String component1() { + return getReverseDomainName(); + } + + @Override + public String component2() { + return getSemanticId(); + } + + @Override + public String component3() { + return getSemver(); + } + + @Override + public String component4() { + return getQueryText(); + } + + @Override + public String component5() { + return getType(); + } + + @Override + public OffsetDateTime component6() { + return getCreationDate(); + } + + @Override + public String value1() { + return getReverseDomainName(); + } + + @Override + public String value2() { + return getSemanticId(); + } + + @Override + public String value3() { + return getSemver(); + } + + @Override + public String value4() { + return getQueryText(); + } + + @Override + public String value5() { + return getType(); + } + + @Override + public OffsetDateTime value6() { + return getCreationDate(); + } + + @Override + public StoredQueryRecord value1(String value) { + setReverseDomainName(value); + return this; + } + + @Override + public StoredQueryRecord value2(String value) { + setSemanticId(value); + return this; + } + + @Override + public StoredQueryRecord value3(String value) { + setSemver(value); + return this; + } + + @Override + public StoredQueryRecord value4(String value) { + setQueryText(value); + return this; + } + + @Override + public StoredQueryRecord value5(String value) { + setType(value); + return this; + } + + @Override + public StoredQueryRecord value6(OffsetDateTime value) { + setCreationDate(value); + return this; + } + + @Override + public StoredQueryRecord values( + String value1, String value2, String value3, String value4, String value5, OffsetDateTime value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached StoredQueryRecord + */ + public StoredQueryRecord() { + super(StoredQuery.STORED_QUERY); + } + + /** + * Create a detached, initialised StoredQueryRecord + */ + public StoredQueryRecord( + String reverseDomainName, + String semanticId, + String semver, + String queryText, + String type, + OffsetDateTime creationDate) { + super(StoredQuery.STORED_QUERY); + + setReverseDomainName(reverseDomainName); + setSemanticId(semanticId); + setSemver(semver); + setQueryText(queryText); + setType(type); + setCreationDate(creationDate); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/TemplateStoreRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/TemplateStoreRecord.java new file mode 100644 index 0000000..70495a0 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/TemplateStoreRecord.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.time.OffsetDateTime; +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.TemplateStore; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class TemplateStoreRecord extends UpdatableRecordImpl + implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.template_store.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.template_store.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.template_store.template_id. + */ + public void setTemplateId(String value) { + set(1, value); + } + + /** + * Getter for ehr.template_store.template_id. + */ + public String getTemplateId() { + return (String) get(1); + } + + /** + * Setter for ehr.template_store.content. + */ + public void setContent(String value) { + set(2, value); + } + + /** + * Getter for ehr.template_store.content. + */ + public String getContent() { + return (String) get(2); + } + + /** + * Setter for ehr.template_store.creation_time. + */ + public void setCreationTime(OffsetDateTime value) { + set(3, value); + } + + /** + * Getter for ehr.template_store.creation_time. + */ + public OffsetDateTime getCreationTime() { + return (OffsetDateTime) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return TemplateStore.TEMPLATE_STORE.ID; + } + + @Override + public Field field2() { + return TemplateStore.TEMPLATE_STORE.TEMPLATE_ID; + } + + @Override + public Field field3() { + return TemplateStore.TEMPLATE_STORE.CONTENT; + } + + @Override + public Field field4() { + return TemplateStore.TEMPLATE_STORE.CREATION_TIME; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getTemplateId(); + } + + @Override + public String component3() { + return getContent(); + } + + @Override + public OffsetDateTime component4() { + return getCreationTime(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getTemplateId(); + } + + @Override + public String value3() { + return getContent(); + } + + @Override + public OffsetDateTime value4() { + return getCreationTime(); + } + + @Override + public TemplateStoreRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public TemplateStoreRecord value2(String value) { + setTemplateId(value); + return this; + } + + @Override + public TemplateStoreRecord value3(String value) { + setContent(value); + return this; + } + + @Override + public TemplateStoreRecord value4(OffsetDateTime value) { + setCreationTime(value); + return this; + } + + @Override + public TemplateStoreRecord values(UUID value1, String value2, String value3, OffsetDateTime value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TemplateStoreRecord + */ + public TemplateStoreRecord() { + super(TemplateStore.TEMPLATE_STORE); + } + + /** + * Create a detached, initialised TemplateStoreRecord + */ + public TemplateStoreRecord(UUID id, String templateId, String content, OffsetDateTime creationTime) { + super(TemplateStore.TEMPLATE_STORE); + + setId(id); + setTemplateId(templateId); + setContent(content); + setCreationTime(creationTime); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/UsersRecord.java b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/UsersRecord.java new file mode 100644 index 0000000..81c21cf --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/importer/v4/jooq/pg/tables/records/UsersRecord.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.importer.v4.jooq.pg.tables.records; + +import java.util.UUID; +import org.ehrbase.migration.importer.v4.jooq.pg.tables.Users; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.UpdatableRecordImpl; + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"}) +public class UsersRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for ehr.users.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for ehr.users.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for ehr.users.username. + */ + public void setUsername(String value) { + set(1, value); + } + + /** + * Getter for ehr.users.username. + */ + public String getUsername() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return Users.USERS.ID; + } + + @Override + public Field field2() { + return Users.USERS.USERNAME; + } + + @Override + public UUID component1() { + return getId(); + } + + @Override + public String component2() { + return getUsername(); + } + + @Override + public UUID value1() { + return getId(); + } + + @Override + public String value2() { + return getUsername(); + } + + @Override + public UsersRecord value1(UUID value) { + setId(value); + return this; + } + + @Override + public UsersRecord value2(String value) { + setUsername(value); + return this; + } + + @Override + public UsersRecord values(UUID value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached UsersRecord + */ + public UsersRecord() { + super(Users.USERS); + } + + /** + * Create a detached, initialised UsersRecord + */ + public UsersRecord(UUID id, String username) { + super(Users.USERS); + + setId(id); + setUsername(username); + resetChangedOnNotNull(); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/service/Batch.java b/service/src/main/java/org/ehrbase/migration/service/Batch.java new file mode 100644 index 0000000..6481812 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/service/Batch.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.service; + +import java.util.Optional; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +record Batch(int start, int size) { + /** + * + * @param page 0-indexed page nr + * @param batchSize (regular) size of batches + * @param fullSize aximum number of batches + * @return + */ + static Batch page(int page, int batchSize, int fullSize) { + if (page < 0 || batchSize < 1) { + throw new IndexOutOfBoundsException(); + } + int start = page * batchSize; + if (fullSize < start) { + throw new IndexOutOfBoundsException(); + } + if (start + batchSize > fullSize) { + int remainingSize = fullSize - start; + if (remainingSize < 1) { + throw new IndexOutOfBoundsException(); + } + return new Batch(start, remainingSize); + } else { + return new Batch(start, batchSize); + } + } + + static Stream stream(int batchSize, int fullSize) { + int fullBatches = fullSize / batchSize; + + int remainderCount = fullSize % batchSize; + Optional remainderBatch = + Optional.of(remainderCount).filter(c -> c > 0).map(c -> new Batch(batchSize * fullBatches, c)); + + return Stream.concat( + IntStream.range(0, fullBatches).mapToObj(i -> Batch.page(i, batchSize, fullSize)), + remainderBatch.stream()); + } + + public int calcEndInclusive() { + return start + size - 1; + } + + @Override + public String toString() { + return "%d - %d".formatted(start, calcEndInclusive()); + } +} diff --git a/service/src/main/java/org/ehrbase/migration/service/FileService.java b/service/src/main/java/org/ehrbase/migration/service/FileService.java new file mode 100644 index 0000000..eb99fc6 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/service/FileService.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.service; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.File; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; +import net.lingala.zip4j.ZipFile; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.model.ZipParameters; +import org.apache.commons.io.IOUtils; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.openehr.sdk.serialisation.jsonencoding.ArchieObjectMapperProvider; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +@Service +public class FileService { + + private static final ObjectMapper OM = + ArchieObjectMapperProvider.getObjectMapper().copy(); + + public static final String TENANTS_ZIP = "tenants.zip"; + public static final String EHR_SCHEMA_DATA_ZIP = "ehr_schema_data.zip"; + private static final String EHR_SCHEMA_DATA_JSON = "ehr_schema_data.json"; + + @Value("${export.folder}") + private String exportFolder; + + @Value("${import.folder}") + private String importFolder; + + public void write(ProcessService.EhrBatch batch, EhrSchema t) { + + File base = Path.of(exportFolder, t.tenantId()).toFile(); + base.mkdirs(); + + try (ZipFile zipFile = new ZipFile(new File( + base, + "ehrs_%s_%s.zip".formatted(batch.batch().start(), batch.batch().calcEndInclusive())))) { + + batch.ehrs().forEach(ehr -> addToZip(ehr, zipFile, ehr.getEhrId() + ".json")); + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + public void write(EhrSchemaData ehrSchemaData, EhrSchema t) { + File base = Path.of(exportFolder, t.tenantId()).toFile(); + base.mkdirs(); + + try (ZipFile zipFile = new ZipFile(new File(base, EHR_SCHEMA_DATA_ZIP))) { + addToZip(ehrSchemaData, zipFile, EHR_SCHEMA_DATA_JSON); + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + public void write(List tenants) { + File base = Path.of(exportFolder).toFile(); + base.mkdirs(); + + try (ZipFile zipFile = new ZipFile(new File(base, TENANTS_ZIP))) { + + tenants.forEach(t -> addToZip(t, zipFile, t.tenantId() + ".json")); + + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + private static void addToZip(Object other, ZipFile zipFile, String fileNameInZip) { + + ZipParameters zp = new ZipParameters(); + zp.setFileNameInZip(fileNameInZip); + + try { + zipFile.addStream(IOUtils.toInputStream(OM.writeValueAsString(other), StandardCharsets.UTF_8), zp); + } catch (JsonProcessingException | ZipException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + public List readEhrs(String file, EhrSchema t) { + File base = Path.of(importFolder, t.tenantId()).toFile(); + + List ehrs; + try (ZipFile zipFile = new ZipFile(new File(base, file))) { + + ehrs = read(zipFile, ExtendedEhr.class); + + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + return ehrs; + } + + public EhrSchemaData readEhrSchemaData(EhrSchema t) { + File base = Path.of(importFolder, t.tenantId()).toFile(); + + try (ZipFile zipFile = new ZipFile(new File(base, EHR_SCHEMA_DATA_ZIP))) { + return read(zipFile, EhrSchemaData.class).get(0); + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + public List readEhrFileNames(EhrSchema t) { + File base = Path.of(importFolder, t.tenantId()).toFile(); + try (Stream pathStream = Files.list(base.toPath())) { + return pathStream + .map(Path::getFileName) + .map(Path::toString) + .filter(p -> p.contains("ehr")) + .toList(); + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + public List readTenants() { + Path base = Path.of(importFolder); + + try (ZipFile zipFile = new ZipFile(base.resolve(TENANTS_ZIP).toFile())) { + return read(zipFile, EhrSchema.class); + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + } + + private static List read(ZipFile zipFile, Class tClass) throws ZipException { + + List tenants = new ArrayList<>(); + zipFile.getFileHeaders().forEach(h -> { + try { // XXX close or not? + T e = OM.readValue(zipFile.getInputStream(h), tClass); + tenants.add(e); + } catch (IOException ex) { + throw new UncheckedIOException(ex.getMessage(), ex); + } + }); + + return tenants; + } +} diff --git a/service/src/main/java/org/ehrbase/migration/service/ProcessService.java b/service/src/main/java/org/ehrbase/migration/service/ProcessService.java new file mode 100644 index 0000000..aa50230 --- /dev/null +++ b/service/src/main/java/org/ehrbase/migration/service/ProcessService.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2023 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.service; + +import com.nedap.archie.rm.changecontrol.Contribution; +import com.nedap.archie.rm.composition.Composition; +import com.nedap.archie.rm.directory.Folder; +import com.nedap.archie.rm.ehr.EhrStatus; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.ehrbase.migration.dto.EhrSchema; +import org.ehrbase.migration.dto.EhrSchemaData; +import org.ehrbase.migration.dto.ExtendedEhr; +import org.ehrbase.migration.dto.VersionedObjectData; +import org.ehrbase.migration.exporter.ExportService; +import org.ehrbase.migration.exporter.postprocessor.ExportPostprocessor; +import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr; +import org.ehrbase.migration.importer.v4.EhrSchemaImporter; +import org.ehrbase.migration.importer.v4.ImportService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +@Service +public class ProcessService { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + private final ExportService exportService; + + private final ImportService importService; + + private final FileService fileService; + + @Value("${export.batch-size}") + private Integer batchSize; + + private final List exportPostprocessors; + + private final List allErrors = new ArrayList<>(); + + public ProcessService( + @Autowired(required = false) ExportService exportService, + ImportService importService, + FileService fileService, + List exportPostprocessors) { + this.exportService = exportService; + this.importService = importService; + this.fileService = fileService; + this.exportPostprocessors = exportPostprocessors; + } + + public void exportToFile() { + if (exportService == null) { + throw new IllegalStateException("Export Service is not available"); + } + + List tenants = exportService.getTenants(); + tenants.forEach(t -> { + logger.info("Start export for tenant {} ", t.tenantId()); + exportService.setCurrentTenant(t); + + int ehrCount = exportService.getEhrCount(); + + EhrSchemaData ehrSchemaData = exportService.findEhrSchemaData(); + fileService.write(ehrSchemaData, t); + + streamEhrBatches(t, ehrSchemaData, ehrCount).forEach(p -> { + fileService.write(p, t); + + logger.info("Finished ehrs {} of {} ", p.batch(), ehrCount); + }); + }); + + fileService.write(tenants); + + logErrors(); + } + + private void logErrors() { + + allErrors.forEach(e -> { + logger.warn( + "Error: {}; on tenantId: {}; on ehrId {} ; on voId {}", + e.message(), + e.tenantId(), + e.ehrId(), + e.voId()); + }); + } + + record EhrBatch(Batch batch, List ehrs) {} + + public void db2db() { + if (exportService == null) { + throw new IllegalStateException("Export Service is not available"); + } + + List tenants = exportService.getTenants(); + tenants.forEach(t -> { + logger.info("Start migration of tenant {} ", t.tenantId()); + exportService.setCurrentTenant(t); + + int ehrCount = exportService.getEhrCount(); + + EhrSchemaData ehrSchemaData = exportService.findEhrSchemaData(); + + EhrSchemaImporter importer = importService.createImporter(t, Ehr.EHR.getName()); + importer.writeEhrSchemaData(ehrSchemaData); + + streamEhrBatches(t, ehrSchemaData, ehrCount).forEach(p -> { + logger.info("Start import of ehrs {} of {} ", p.batch(), ehrCount); + writeData(importer, p.ehrs(), ehrSchemaData); + logger.info("Finished import of ehrs {} of {} ", p.batch(), ehrCount); + }); + logger.info("Finished migration of tenant {} ", t.tenantId()); + }); + + logErrors(); + } + + private Stream streamEhrBatches(EhrSchema t, EhrSchemaData ehrSchemaData, int ehrCount) { + return Batch.stream(batchSize, ehrCount) + .map(p1 -> { + logger.info("Processing ehrs {} of {} ", p1, ehrCount); + return p1; + }) + .map(b -> new EhrBatch(b, exportService.findEhrs(b.start(), b.size()))) + .map(eb -> findData(t, eb)) + .map(eb -> { + exportPostprocessors.forEach(pp -> eb.ehrs().forEach(ehr -> { + List migrationErrors = pp.postExport(ehr, ehrSchemaData, t); + + migrationErrors.forEach(e -> allErrors.add(new ExportPostprocessor.MigrationError( + t.tenantId(), e.ehrId(), e.voId(), e.message()))); + })); + return eb; + }); + } + + public void importFromFile() { + + fileService.readTenants().forEach(t -> { + logger.info("Start import for tenant {} ", t.tenantId()); + EhrSchemaData ehrSchemaData = fileService.readEhrSchemaData(t); + EhrSchemaImporter importer = importService.createImporter(t, Ehr.EHR.getName()); + fileService.readEhrFileNames(t).parallelStream() + .map(f -> { + logger.info("Import %s".formatted(f)); + return f; + }) + .map(f -> fileService.readEhrs(f, t)) + .forEach(extendedEhrs -> writeData(importer, extendedEhrs, ehrSchemaData)); + }); + logErrors(); + } + + private void writeData( + EhrSchemaImporter ehrSchemaDataImporter, List extendedEhrs, EhrSchemaData ehrSchemaData) { + + ehrSchemaDataImporter.writeEhr(extendedEhrs); + + List subEhrs = extendedEhrs; + + ehrSchemaDataImporter.writeContribution( + subEhrs.stream().collect(Collectors.toMap(ExtendedEhr::getEhrId, ExtendedEhr::getContributions)), + ehrSchemaData); + ehrSchemaDataImporter.writeStatus( + new ImportService.VersionedObjectByEhr<>(subEhrs, ee -> List.of(ee.getEhrStatus())), ehrSchemaData); + ehrSchemaDataImporter.writeEhrFolder( + new ImportService.VersionedObjectByEhr<>(subEhrs, ExtendedEhr::getFolders), ehrSchemaData); + ehrSchemaDataImporter.writeComposition( + new ImportService.VersionedObjectByEhr<>(subEhrs, ExtendedEhr::getCompositions), + ehrSchemaData, + id -> ehrSchemaData.getTemplateUuid(ehrSchemaData.getTemplateByTemplateId(id))); + } + + private EhrBatch findData(EhrSchema t, EhrBatch eb) { + + Map byEhrId = + eb.ehrs().stream().collect(Collectors.toMap(ExtendedEhr::getEhrId, Function.identity())); + + Map>> compositions = + exportService.findCompositions(byEhrId.keySet(), t); + + compositions.forEach((key, value) -> byEhrId.get(key).setCompositions(value)); + + Map>> status = exportService.findStatus(byEhrId.keySet(), t); + status.forEach((k, v) -> byEhrId.get(k).setEhrStatus(v.getFirst())); + + Map>> foldersByEhr = exportService.findFolder(byEhrId.keySet(), t); + + foldersByEhr.forEach((eid, fs) -> { + byEhrId.get(eid).setFolders(fs); + // There is one folder, which is the directory + byEhrId.get(eid).setDirectory(fs.getFirst().uuid()); + }); + + Map> contributions = exportService.findContributions(byEhrId.keySet()); + + contributions.forEach((k, v) -> byEhrId.get(k).setContributions(v)); + + byEhrId.values().forEach(exportService::postProcess); + + return eb; + } +} diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml new file mode 100644 index 0000000..1b3307b --- /dev/null +++ b/service/src/main/resources/application.yml @@ -0,0 +1,28 @@ +spring: + datasource: + import: + url: jdbc:postgresql://localhost:5432/ehrbase + username: ehrbase + password: ehrbase + export: + enable: true + url: jdbc:postgresql://localhost:5432/ehrbase + username: ehrbase + password: ehrbase + + +export: + batch-size: 100 + folder: ./migration + postprocessors: + validation: + enable: true +import: + # the regular db user, needed for the db migration + ehrbase-db-user: ehrbase_restricted + folder: ./migration +mode: NONE + +logging: + level: + org.jooq.impl: ERROR \ No newline at end of file diff --git a/service/src/main/resources/db/migration/ehr/V10__ehr_status_subject_aql_idx.sql b/service/src/main/resources/db/migration/ehr/V10__ehr_status_subject_aql_idx.sql new file mode 100644 index 0000000..6d97d31 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V10__ehr_status_subject_aql_idx.sql @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +DROP INDEX IF EXISTS ehr_status_subject_idx; + +ALTER INDEX IF EXISTS prep_ehr_status_subject_idx RENAME TO ehr_status_subject_idx; + +CREATE UNIQUE INDEX IF NOT EXISTS ehr_status_subject_idx ON ehr_status_data USING btree + ((data -> 'su' -> 'er' -> 'X' -> 'V' ->> 0), + (data -> 'su' -> 'er' -> 'ns' ->> 0)) + INCLUDE (ehr_id, num) + WHERE (rm_entity = 'ES'); diff --git a/service/src/main/resources/db/migration/ehr/V11__drop_system.sql b/service/src/main/resources/db/migration/ehr/V11__drop_system.sql new file mode 100644 index 0000000..d86dc2b --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V11__drop_system.sql @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +alter table audit_details drop column system_id cascade; +drop table system; \ No newline at end of file diff --git a/service/src/main/resources/db/migration/ehr/V12__drop_template_index.sql b/service/src/main/resources/db/migration/ehr/V12__drop_template_index.sql new file mode 100644 index 0000000..538f637 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V12__drop_template_index.sql @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +DROP INDEX IF EXISTS comp_version_template_idx; diff --git a/service/src/main/resources/db/migration/ehr/V13__refactor_audit_details.sql b/service/src/main/resources/db/migration/ehr/V13__refactor_audit_details.sql new file mode 100644 index 0000000..344d3a1 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V13__refactor_audit_details.sql @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +-- Drop CONTRIBUTION.state: ContributionState +ALTER TABLE contribution + DROP COLUMN IF EXISTS state; +DROP TYPE contribution_state; + +-- AUDIT_DETAILS.target_type: {CT, CO, ES, EF} +ALTER TABLE audit_details + ADD COLUMN IF NOT EXISTS target_type varchar NOT NULL DEFAULT 'XX'; +-- update from version tables +-- @formatter:off +UPDATE audit_details set target_type='CO' WHERE target_type = 'XX' AND id in (select audit_id from comp_version); +UPDATE audit_details set target_type='CO' WHERE target_type = 'XX' AND id in (select audit_id from comp_version_history); +UPDATE audit_details set target_type='ES' WHERE target_type = 'XX' AND id in (select audit_id from ehr_status_version); +UPDATE audit_details set target_type='ES' WHERE target_type = 'XX' AND id in (select audit_id from ehr_status_version_history); +UPDATE audit_details set target_type='EF' WHERE target_type = 'XX' AND id in (select audit_id from ehr_folder_version); +UPDATE audit_details set target_type='EF' WHERE target_type = 'XX' AND id in (select audit_id from ehr_folder_version_history); +UPDATE audit_details set target_type='CT' WHERE target_type = 'XX'; +-- @formatter:on +ALTER TABLE audit_details + ALTER COLUMN target_type DROP DEFAULT; + +-- Index on *_VERSION.sys_period_lower +CREATE INDEX comp_version_sys_period_lower_idx ON comp_version USING btree (sys_period_lower DESC, vo_id ASC); +CREATE INDEX ehr_status_version_sys_period_lower_idx ON ehr_status_version USING btree (sys_period_lower DESC, ehr_id ASC); +--CREATE INDEX ehr_folder_version_sys_period_lower_idx ON ehr.ehr_folder_version USING btree (sys_period_lower ASC, ehr_id ASC); diff --git a/service/src/main/resources/db/migration/ehr/V14__index_for_ehr_time_created.sql b/service/src/main/resources/db/migration/ehr/V14__index_for_ehr_time_created.sql new file mode 100644 index 0000000..dfe3bb2 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V14__index_for_ehr_time_created.sql @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + + +CREATE INDEX ehr_time_created_idx ON ehr USING btree (creation_date DESC, id ASC); diff --git a/service/src/main/resources/db/migration/ehr/V1__ehr.sql b/service/src/main/resources/db/migration/ehr/V1__ehr.sql new file mode 100644 index 0000000..9749d06 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V1__ehr.sql @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +create sequence tenant_id_seq; + + +create type contribution_data_type as enum ('composition', 'folder', 'ehr', 'system', 'other'); +create type contribution_state as enum ('complete', 'incomplete', 'deleted'); +create type contribution_change_type as enum ('creation', 'amendment', 'modification', 'synthesis', 'Unknown', 'deleted'); + +create table plugin +( + id uuid default uuid_generate_v4() not null + constraint plugin_pkey + primary key, + pluginid text not null, + key text not null, + value text +); + +comment on table plugin is 'key value store for plugin sub system'; + +create table system +( + id uuid default uuid_generate_v4() not null + constraint system_pkey + primary key, + description text not null, + settings text not null + constraint ehr_system_settings_idx + unique +); + +comment on table system is 'system table for reference'; + +create table tenant +( + id int2 default nextval('tenant_id_seq'::regclass) not null + constraint tenant_pkey + primary key, + tenant_id text + constraint tenant_tenant_id_key + unique, + tenant_properties jsonb, + tenant_name text + constraint tenant_tenant_name_key + unique +); + +create table ehr +( + id uuid not null, + sys_tenant int2 not null + constraint ehr_sys_tenant_fkey + references tenant, + creation_date timestamptz(6), + constraint ehr_pkey + primary key (id, sys_tenant +) + ); + +ALTER TABLE ehr + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON ehr FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +create table users +( + id uuid not null + constraint users_pkey + primary key, + username text not null, + sys_tenant int2 not null + constraint users_sys_tenant_fkey + references tenant +); + +CREATE UNIQUE INDEX users_username_idx on users (username, sys_tenant); + +ALTER TABLE users + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON users FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + + +create table audit_details +( + id uuid not null, + system_id uuid not null + constraint audit_details_system_id_fkey + references system, + change_type "contribution_change_type" not null, + description text, + sys_tenant int2 not null + constraint audit_details_sys_tenant_fkey + references tenant, + time_committed timestamptz(6) not null, + committer jsonb, + user_id uuid not null + constraint audit_details_user_id_fkey + references users, + constraint audit_details_pkey + primary key (id, sys_tenant +) + ); + +ALTER TABLE audit_details + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON audit_details FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + + +create table contribution +( + id uuid not null, + ehr_id uuid, + contribution_type "contribution_data_type", + state "contribution_state", + signature text, + has_audit uuid, + sys_tenant int2 not null + constraint contribution_sys_tenant_fkey + references tenant, + constraint contribution_pkey + primary key (id, sys_tenant +) , + constraint contribution_ehr_id_fkey + foreign key (ehr_id, sys_tenant) references ehr (id, sys_tenant) + on delete cascade, + constraint contribution_has_audit_fkey + foreign key (has_audit, sys_tenant) references audit_details + on delete cascade +); + +create index contribution_ehr_idx + on contribution (ehr_id, sys_tenant); + +ALTER TABLE contribution + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON contribution FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +create table stored_query +( + reverse_domain_name varchar not null, + semantic_id varchar not null, + semver varchar default '0.0.0' not null, + query_text varchar not null, + type varchar default 'AQL', + sys_tenant int2 not null + constraint stored_query_sys_tenant_fkey + references tenant, + creation_date timestamptz(6) not null, + constraint stored_query_pkey + primary key (reverse_domain_name, semantic_id, sys_tenant, + semver +) + ); + +ALTER TABLE stored_query + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON stored_query FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +create table template_store +( + id uuid not null, + template_id text not null, + content text, + sys_tenant int2 not null + constraint template_store_sys_tenant_fkey + references tenant, + creation_time timestamptz(6) not null, + constraint template_store_pkey + primary key (id, sys_tenant +) + ); + +CREATE UNIQUE INDEX template_store_id_unq on template_store (template_id, sys_tenant); + +ALTER TABLE template_store + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON template_store FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); diff --git a/service/src/main/resources/db/migration/ehr/V2__tenant.sql b/service/src/main/resources/db/migration/ehr/V2__tenant.sql new file mode 100644 index 0000000..9b5aada --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V2__tenant.sql @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +INSERT INTO tenant (tenant_id, tenant_name) +VALUES ('1f332a66-0e57-11ed-861d-0242ac120002', 'default_tenant'); diff --git a/service/src/main/resources/db/migration/ehr/V3__locatable.sql b/service/src/main/resources/db/migration/ehr/V3__locatable.sql new file mode 100644 index 0000000..f8aa3ab --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V3__locatable.sql @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +create table ehr_status +( + vo_id uuid NOT NULL, + num int4 NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + citem_num int4, + rm_entity text NOT NULL, + entity_concept text, + entity_name text collate "en_US", + entity_attribute text, + entity_path text collate "C" NOT NULL, + entity_path_cap text collate "C" NOT NULL, + entity_idx text collate "C" NOT NULL, + entity_idx_cap text collate "C" NOT NULL, + entity_idx_len int4 NOT NULL, + data jsonb NOT NULL, + sys_tenant int2 NOT NULL, + sys_version int4 NOT NULL, + sys_period_lower timestamptz(6) NOT NULL, + + PRIMARY KEY (ehr_id, sys_tenant,num), + FOREIGN KEY (audit_id, sys_tenant) references audit_details (id, sys_tenant), + FOREIGN KEY (contribution_id, sys_tenant) references contribution (id, sys_tenant), + FOREIGN KEY (ehr_id, sys_tenant) references ehr (id, sys_tenant), + FOREIGN KEY (sys_tenant) references tenant (id) +); + +create unique index ehr_status_subject on ehr_status ( + jsonb_extract_path_text("ehr_status"."data", 'su', 'er', 'X', 'V'), + jsonb_extract_path_text("ehr_status"."data", 'su', 'er', 'ns'), + sys_tenant +) INCLUDE (ehr_id) +where num = 0; + + +ALTER TABLE ehr_status + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON ehr_status FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +create table ehr_status_history +( + vo_id uuid NOT NULL, + num int4 NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + citem_num int4, + rm_entity text NOT NULL, + entity_concept text, + entity_name text collate "en_US", + entity_attribute text, + entity_path text collate "C" NOT NULL, + entity_path_cap text collate "C" NOT NULL, + entity_idx text collate "C" NOT NULL, + entity_idx_cap text collate "C" NOT NULL, + entity_idx_len int4 NOT NULL, + data jsonb NOT NULL, + sys_tenant int2 NOT NULL, + sys_version int4 NOT NULL, + sys_period_lower timestamptz(6) NOT NULL, + sys_period_upper timestamptz(6), + sys_deleted bool NOT NULL, + + PRIMARY KEY (ehr_id, sys_tenant,num,sys_version), + FOREIGN KEY (audit_id, sys_tenant) references audit_details (id, sys_tenant), + FOREIGN KEY (contribution_id, sys_tenant) references contribution (id, sys_tenant), + FOREIGN KEY (ehr_id, sys_tenant) references ehr (id, sys_tenant), + FOREIGN KEY (sys_tenant) references tenant(id) +); + +ALTER TABLE ehr_status_history + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON ehr_status_history FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +create table ehr_folder +( + vo_id uuid NOT NULL, + num int4 NOT NULL, + ehr_id uuid NOT NULL, + ehr_folders_idx int4 NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + citem_num int4, + rm_entity text NOT NULL, + entity_concept text, + entity_name text collate "en_US", + entity_attribute text, + entity_path text collate "C" NOT NULL, + entity_path_cap text collate "C" NOT NULL, + entity_idx text collate "C" NOT NULL, + entity_idx_cap text collate "C" NOT NULL, + entity_idx_len int4 NOT NULL, + data jsonb NOT NULL, + sys_tenant int2 NOT NULL, + sys_version int4 NOT NULL, + sys_period_lower timestamptz(6) NOT NULL, + + PRIMARY KEY (ehr_id,ehr_folders_idx, sys_tenant, num), + FOREIGN KEY (audit_id, sys_tenant) references audit_details (id, sys_tenant), + FOREIGN KEY (contribution_id, sys_tenant) references contribution (id, sys_tenant), + FOREIGN KEY (ehr_id, sys_tenant) references ehr (id, sys_tenant), + FOREIGN KEY (sys_tenant) references tenant (id) +); + +ALTER TABLE ehr_folder + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON ehr_folder FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + + +create table ehr_folder_history +( + vo_id uuid NOT NULL, + num int4 NOT NULL, + ehr_id uuid NOT NULL, + ehr_folders_idx int4 NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + citem_num int4, + rm_entity text NOT NULL, + entity_concept text, + entity_name text collate "en_US", + entity_attribute text, + entity_path text collate "C" NOT NULL, + entity_path_cap text collate "C" NOT NULL, + entity_idx text collate "C" NOT NULL, + entity_idx_cap text collate "C" NOT NULL, + entity_idx_len int4 NOT NULL, + data jsonb NOT NULL, + sys_tenant int2 NOT NULL, + sys_version int4 NOT NULL, + sys_period_lower timestamptz(6) NOT NULL, + sys_period_upper timestamptz(6), + sys_deleted bool NOT NULL, + + PRIMARY KEY (ehr_id,ehr_folders_idx, sys_tenant, num, sys_version), + FOREIGN KEY (audit_id, sys_tenant) references audit_details (id, sys_tenant), + FOREIGN KEY (contribution_id, sys_tenant) references contribution (id, sys_tenant), + FOREIGN KEY (ehr_id, sys_tenant) references ehr (id, sys_tenant), + FOREIGN KEY (sys_tenant) references tenant(id) +); + +ALTER TABLE ehr_folder_history + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON ehr_folder_history FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +create table comp +( + vo_id uuid NOT NULL, + num integer NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + template_id uuid NOT NULL, + citem_num int4, + rm_entity text NOT NULL, + entity_concept text, + entity_name text collate "en_US", + entity_attribute text, + entity_path text collate "C" NOT NULL, + entity_path_cap text collate "C" NOT NULL, + entity_idx text collate "C" NOT NULL, + entity_idx_cap text collate "C" NOT NULL, + --for querying direct children + entity_idx_len INTEGER NOT NULL, + + --data... + + data jsonb NOT NULL, + + sys_tenant SMALLINT NOT NULL, + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + + PRIMARY KEY (vo_id, sys_tenant, num), + FOREIGN KEY (ehr_id, sys_tenant) REFERENCES ehr (id, sys_tenant), + FOREIGN KEY (contribution_id, sys_tenant) REFERENCES contribution (id, sys_tenant), + FOREIGN KEY (audit_id, sys_tenant) REFERENCES audit_details (id, sys_tenant), + FOREIGN KEY (template_id, sys_tenant) REFERENCES template_store (id, sys_tenant), + FOREIGN KEY (sys_tenant) REFERENCES tenant (id) +); + +ALTER TABLE comp + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON comp FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + + +create table comp_history +( + vo_id uuid NOT NULL, + num integer NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + template_id uuid NOT NULL, + citem_num int4, + rm_entity text NOT NULL, + entity_concept text, + entity_name text collate "en_US", + entity_attribute text, + entity_path text collate "C" NOT NULL, + entity_path_cap text collate "C" NOT NULL, + entity_idx text collate "C" NOT NULL, + entity_idx_cap text collate "C" NOT NULL, + --for querying direct children + entity_idx_len INTEGER NOT NULL, + + --data... + data jsonb NOT NULL, + + sys_tenant smallint NOT NULL, + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + sys_period_upper timestamptz, + sys_deleted boolean NOT NULL, + PRIMARY KEY (vo_id, sys_tenant, num, sys_version), + FOREIGN KEY (ehr_id, sys_tenant) REFERENCES ehr (id, sys_tenant), + FOREIGN KEY (contribution_id, sys_tenant) REFERENCES contribution (id, sys_tenant), + FOREIGN KEY (audit_id, sys_tenant) REFERENCES audit_details (id, sys_tenant), + FOREIGN KEY (template_id, sys_tenant) REFERENCES template_store (id, sys_tenant), + FOREIGN KEY (sys_tenant) REFERENCES tenant (id) +); + +ALTER TABLE comp_history + ENABLE ROW LEVEL SECURITY, + FORCE ROW LEVEL SECURITY; +CREATE POLICY ehr_policy_all ON comp_history FOR ALL USING (sys_tenant = current_setting('ehrbase.current_tenant')::smallint); + +CREATE INDEX comp_struc_ehr_idx + ON comp USING btree + (sys_tenant, ehr_id, + vo_id, + rm_entity, + entity_idx, + entity_concept, + entity_name collate "en_US") + INCLUDE (entity_idx_cap, num, sys_version); + +CREATE INDEX comp_struc_idx ON comp + (sys_tenant, rm_entity, + vo_id, + entity_idx, + entity_concept, + entity_name collate "en_US") + INCLUDE(ehr_id, entity_idx_cap, num, sys_version); + +CREATE INDEX comp_data_idx + ON comp USING btree + (sys_tenant, vo_id); diff --git a/service/src/main/resources/db/migration/ehr/V4__drop_comp_data_idx.sql b/service/src/main/resources/db/migration/ehr/V4__drop_comp_data_idx.sql new file mode 100644 index 0000000..82d0a98 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V4__drop_comp_data_idx.sql @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +DROP INDEX IF EXISTS comp_data_idx; diff --git a/service/src/main/resources/db/migration/ehr/V5_1__remove_multi_tenancy.sql b/service/src/main/resources/db/migration/ehr/V5_1__remove_multi_tenancy.sql new file mode 100644 index 0000000..a885d99 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V5_1__remove_multi_tenancy.sql @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +--drop foreign keys referencing tenant table +ALTER TABLE audit_details DROP CONSTRAINT audit_details_sys_tenant_fkey; +ALTER TABLE comp_history DROP CONSTRAINT comp_history_sys_tenant_fkey; +ALTER TABLE comp DROP CONSTRAINT comp_sys_tenant_fkey; +ALTER TABLE contribution DROP CONSTRAINT contribution_sys_tenant_fkey; +ALTER TABLE ehr_folder_history DROP CONSTRAINT ehr_folder_history_sys_tenant_fkey; +ALTER TABLE ehr_folder DROP CONSTRAINT ehr_folder_sys_tenant_fkey; +ALTER TABLE ehr_status_history DROP CONSTRAINT ehr_status_history_sys_tenant_fkey; +ALTER TABLE ehr_status DROP CONSTRAINT ehr_status_sys_tenant_fkey; +ALTER TABLE ehr DROP CONSTRAINT ehr_sys_tenant_fkey; +ALTER TABLE stored_query DROP CONSTRAINT stored_query_sys_tenant_fkey; +ALTER TABLE template_store DROP CONSTRAINT template_store_sys_tenant_fkey; +ALTER TABLE users DROP CONSTRAINT users_sys_tenant_fkey; + +--drop tenant table +DROP TABLE tenant; + +--drop foreign keys referencing sys_tenant +ALTER TABLE comp DROP CONSTRAINT comp_audit_id_sys_tenant_fkey; +ALTER TABLE comp DROP CONSTRAINT comp_contribution_id_sys_tenant_fkey; +ALTER TABLE comp DROP CONSTRAINT comp_ehr_id_sys_tenant_fkey; +ALTER TABLE comp DROP CONSTRAINT comp_template_id_sys_tenant_fkey; +ALTER TABLE comp_history DROP CONSTRAINT comp_history_audit_id_sys_tenant_fkey; +ALTER TABLE comp_history DROP CONSTRAINT comp_history_contribution_id_sys_tenant_fkey; +ALTER TABLE comp_history DROP CONSTRAINT comp_history_ehr_id_sys_tenant_fkey; +ALTER TABLE comp_history DROP CONSTRAINT comp_history_template_id_sys_tenant_fkey; +ALTER TABLE contribution DROP CONSTRAINT contribution_ehr_id_fkey; +ALTER TABLE contribution DROP CONSTRAINT contribution_has_audit_fkey; +ALTER TABLE ehr_folder DROP CONSTRAINT ehr_folder_ehr_id_sys_tenant_fkey; +ALTER TABLE ehr_folder DROP CONSTRAINT ehr_folder_audit_id_sys_tenant_fkey; +ALTER TABLE ehr_folder DROP CONSTRAINT ehr_folder_contribution_id_sys_tenant_fkey; +ALTER TABLE ehr_folder_history DROP CONSTRAINT ehr_folder_history_ehr_id_sys_tenant_fkey; +ALTER TABLE ehr_folder_history DROP CONSTRAINT ehr_folder_history_audit_id_sys_tenant_fkey; +ALTER TABLE ehr_folder_history DROP CONSTRAINT ehr_folder_history_contribution_id_sys_tenant_fkey; +ALTER TABLE ehr_status DROP CONSTRAINT ehr_status_ehr_id_sys_tenant_fkey; +ALTER TABLE ehr_status DROP CONSTRAINT ehr_status_audit_id_sys_tenant_fkey; +ALTER TABLE ehr_status DROP CONSTRAINT ehr_status_contribution_id_sys_tenant_fkey; +ALTER TABLE ehr_status_history DROP CONSTRAINT ehr_status_history_ehr_id_sys_tenant_fkey; +ALTER TABLE ehr_status_history DROP CONSTRAINT ehr_status_history_audit_id_sys_tenant_fkey; +ALTER TABLE ehr_status_history DROP CONSTRAINT ehr_status_history_contribution_id_sys_tenant_fkey; + +--remove indexes using sys_tenant +DROP INDEX comp_struc_ehr_idx; +DROP INDEX comp_struc_idx; +DROP INDEX contribution_ehr_idx; +DROP INDEX ehr_status_subject; +DROP INDEX template_store_id_unq; +DROP INDEX users_username_idx; + + +--disable RLS +ALTER TABLE audit_details DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE comp_history DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE comp DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE contribution DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE ehr_folder_history DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE ehr_folder DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE ehr DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE ehr_status_history DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE ehr_status DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE stored_query DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE template_store DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; +ALTER TABLE users DISABLE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY; + + +--drop RLS policies +DROP POLICY ehr_policy_all ON audit_details; +DROP POLICY ehr_policy_all ON comp_history; +DROP POLICY ehr_policy_all ON comp; +DROP POLICY ehr_policy_all ON contribution; +DROP POLICY ehr_policy_all ON ehr_folder_history; +DROP POLICY ehr_policy_all ON ehr_folder; +DROP POLICY ehr_policy_all ON ehr; +DROP POLICY ehr_policy_all ON ehr_status_history; +DROP POLICY ehr_policy_all ON ehr_status; +DROP POLICY ehr_policy_all ON stored_query; +DROP POLICY ehr_policy_all ON template_store; +DROP POLICY ehr_policy_all ON users; diff --git a/service/src/main/resources/db/migration/ehr/V5_2__remove_multi_tenancy.sql b/service/src/main/resources/db/migration/ehr/V5_2__remove_multi_tenancy.sql new file mode 100644 index 0000000..db5bf8b --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V5_2__remove_multi_tenancy.sql @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +--replace primary keys +ALTER TABLE audit_details DROP CONSTRAINT audit_details_pkey; +ALTER TABLE audit_details ADD PRIMARY KEY (id); + +ALTER TABLE comp_history DROP CONSTRAINT comp_history_pkey; +ALTER TABLE comp_history ADD PRIMARY KEY (vo_id, num, sys_version); + +ALTER TABLE comp DROP CONSTRAINT comp_pkey; +ALTER TABLE comp ADD PRIMARY KEY (vo_id, num); + +ALTER TABLE contribution DROP CONSTRAINT contribution_pkey; +ALTER TABLE contribution ADD PRIMARY KEY (id); + +ALTER TABLE ehr_folder_history DROP CONSTRAINT ehr_folder_history_pkey; +ALTER TABLE ehr_folder_history ADD PRIMARY KEY (ehr_id, ehr_folders_idx, num, sys_version); + +ALTER TABLE ehr_folder DROP CONSTRAINT ehr_folder_pkey; +ALTER TABLE ehr_folder ADD PRIMARY KEY (ehr_id, ehr_folders_idx, num); + +ALTER TABLE ehr DROP CONSTRAINT ehr_pkey; +ALTER TABLE ehr ADD PRIMARY KEY (id); + +ALTER TABLE ehr_status_history DROP CONSTRAINT ehr_status_history_pkey; +ALTER TABLE ehr_status_history ADD PRIMARY KEY (ehr_id, num, sys_version); + +ALTER TABLE ehr_status DROP CONSTRAINT ehr_status_pkey; +ALTER TABLE ehr_status ADD PRIMARY KEY (ehr_id, num); + +ALTER TABLE stored_query DROP CONSTRAINT stored_query_pkey; +ALTER TABLE stored_query ADD PRIMARY KEY (reverse_domain_name, semantic_id, semver); + +ALTER TABLE template_store DROP CONSTRAINT template_store_pkey; +ALTER TABLE template_store ADD PRIMARY KEY (id); diff --git a/service/src/main/resources/db/migration/ehr/V5_3__remove_multi_tenancy.sql b/service/src/main/resources/db/migration/ehr/V5_3__remove_multi_tenancy.sql new file mode 100644 index 0000000..f6fa5f0 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V5_3__remove_multi_tenancy.sql @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +--drop tenant column +ALTER TABLE audit_details DROP COLUMN sys_tenant; +ALTER TABLE comp_history DROP COLUMN sys_tenant; +ALTER TABLE comp DROP COLUMN sys_tenant; +ALTER TABLE contribution DROP COLUMN sys_tenant; +ALTER TABLE ehr_folder_history DROP COLUMN sys_tenant; +ALTER TABLE ehr_folder DROP COLUMN sys_tenant; +ALTER TABLE ehr DROP COLUMN sys_tenant; +ALTER TABLE ehr_status_history DROP COLUMN sys_tenant; +ALTER TABLE ehr_status DROP COLUMN sys_tenant; +ALTER TABLE stored_query DROP COLUMN sys_tenant; +ALTER TABLE template_store DROP COLUMN sys_tenant; +ALTER TABLE users DROP COLUMN sys_tenant; + + +--recreate foreign keys +ALTER TABLE comp ADD FOREIGN KEY (audit_id) REFERENCES audit_details(id); +ALTER TABLE comp ADD FOREIGN KEY (contribution_id) REFERENCES contribution(id); +ALTER TABLE comp ADD FOREIGN KEY (template_id) REFERENCES template_store(id); +ALTER TABLE comp ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id); +ALTER TABLE comp_history ADD FOREIGN KEY (template_id) REFERENCES template_store(id); +ALTER TABLE comp_history ADD FOREIGN KEY (audit_id) REFERENCES audit_details(id); +ALTER TABLE comp_history ADD FOREIGN KEY (contribution_id) REFERENCES contribution(id); +ALTER TABLE comp_history ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id); +ALTER TABLE contribution ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id) ON DELETE CASCADE; +ALTER TABLE contribution ADD FOREIGN KEY (has_audit) REFERENCES audit_details(id) ON DELETE CASCADE; +ALTER TABLE ehr_folder ADD FOREIGN KEY (audit_id) REFERENCES audit_details(id); +ALTER TABLE ehr_folder ADD FOREIGN KEY (contribution_id) REFERENCES contribution(id); +ALTER TABLE ehr_folder ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id); +ALTER TABLE ehr_folder_history ADD FOREIGN KEY (audit_id) REFERENCES audit_details(id); +ALTER TABLE ehr_folder_history ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id); +ALTER TABLE ehr_folder_history ADD FOREIGN KEY (contribution_id) REFERENCES contribution(id); +ALTER TABLE ehr_status ADD FOREIGN KEY (audit_id) REFERENCES audit_details(id); +ALTER TABLE ehr_status ADD FOREIGN KEY (contribution_id) REFERENCES contribution(id); +ALTER TABLE ehr_status ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id); +ALTER TABLE ehr_status_history ADD FOREIGN KEY (audit_id) REFERENCES audit_details(id); +ALTER TABLE ehr_status_history ADD FOREIGN KEY (contribution_id) REFERENCES contribution(id); +ALTER TABLE ehr_status_history ADD FOREIGN KEY (ehr_id) REFERENCES ehr(id); diff --git a/service/src/main/resources/db/migration/ehr/V5_4__remove_multi_tenancy.sql b/service/src/main/resources/db/migration/ehr/V5_4__remove_multi_tenancy.sql new file mode 100644 index 0000000..0323032 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V5_4__remove_multi_tenancy.sql @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +--recreate indexes +CREATE INDEX contribution_ehr_idx ON contribution USING btree (ehr_id); +CREATE UNIQUE INDEX template_store_id_unq ON template_store USING btree (template_id); +CREATE UNIQUE INDEX users_username_idx ON users USING btree (username); diff --git a/service/src/main/resources/db/migration/ehr/V6_1__version_tables.sql b/service/src/main/resources/db/migration/ehr/V6_1__version_tables.sql new file mode 100644 index 0000000..f0ab2c0 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V6_1__version_tables.sql @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +--Composition +create table comp_version +( + vo_id uuid NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + template_id uuid NOT NULL, + + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + + PRIMARY KEY (vo_id) + ); + +create table comp_version_history +( + vo_id uuid NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + template_id uuid NOT NULL, + + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + sys_period_upper timestamptz, + sys_deleted boolean NOT NULL, + PRIMARY KEY (vo_id, sys_version) + ); + +--EHR_STATUS +create table ehr_status_version +( + vo_id uuid NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + + PRIMARY KEY (ehr_id) + ); + +create table ehr_status_version_history +( + vo_id uuid NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + sys_period_upper timestamptz, + sys_deleted boolean NOT NULL, + PRIMARY KEY (ehr_id, sys_version) + ); + +--EHR Folder +create table ehr_folder_version +( + vo_id uuid NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + + ehr_folders_idx int4 NOT NULL, + + PRIMARY KEY (ehr_id, ehr_folders_idx) + ); + +create table ehr_folder_version_history +( + vo_id uuid NOT NULL, + ehr_id uuid NOT NULL, + contribution_id uuid NOT NULL, + audit_id uuid NOT NULL, + + sys_version INT NOT NULL, + sys_period_lower timestamptz NOT NULL, + + ehr_folders_idx int4 NOT NULL, + + sys_period_upper timestamptz, + sys_deleted boolean NOT NULL, + + PRIMARY KEY (ehr_id, ehr_folders_idx, sys_version) + ); diff --git a/service/src/main/resources/db/migration/ehr/V6_2__version_tables.sql b/service/src/main/resources/db/migration/ehr/V6_2__version_tables.sql new file mode 100644 index 0000000..72ebb6e --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V6_2__version_tables.sql @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +--COMPOSITION +INSERT INTO comp_version ( + vo_id, + ehr_id, + contribution_id, + audit_id, + template_id, + sys_version, + sys_period_lower) +SELECT vo_id, + ehr_id, + contribution_id, + audit_id, + template_id, + sys_version, + sys_period_lower +FROM comp +WHERE num = 0; + + +INSERT INTO comp_version_history ( + vo_id, + ehr_id, + contribution_id, + audit_id, + template_id, + sys_version, + sys_period_lower, + sys_period_upper, + sys_deleted) +SELECT vo_id, + ehr_id, + contribution_id, + audit_id, + template_id, + sys_version, + sys_period_lower, + sys_period_upper, + sys_deleted +FROM comp_history +WHERE num = 0; + +--EHR_STATUS +INSERT INTO ehr_status_version ( + vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower) +SELECT vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower +FROM ehr_status +WHERE num = 0; + + +INSERT INTO ehr_status_version_history ( + vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower, + sys_period_upper, + sys_deleted) +SELECT vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower, + sys_period_upper, + sys_deleted +FROM ehr_status_history +WHERE num = 0; + +--EHR Folder +INSERT INTO ehr_folder_version ( + vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower, + ehr_folders_idx) +SELECT vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower, + ehr_folders_idx +FROM ehr_folder +WHERE num = 0; + + +INSERT INTO ehr_folder_version_history ( + vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower, + ehr_folders_idx, + sys_period_upper, + sys_deleted) +SELECT vo_id, + ehr_id, + contribution_id, + audit_id, + sys_version, + sys_period_lower, + ehr_folders_idx, + sys_period_upper, + sys_deleted +FROM ehr_folder_history +WHERE num = 0; diff --git a/service/src/main/resources/db/migration/ehr/V6_3__version_tables.sql b/service/src/main/resources/db/migration/ehr/V6_3__version_tables.sql new file mode 100644 index 0000000..6e1aa57 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V6_3__version_tables.sql @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +--COMPOSITION +ALTER TABLE comp_version + ADD FOREIGN KEY (ehr_id) REFERENCES ehr (id), + ADD FOREIGN KEY (contribution_id) REFERENCES contribution (id), + ADD FOREIGN KEY (audit_id) REFERENCES audit_details (id), + ADD FOREIGN KEY (template_id) REFERENCES template_store (id); + +ALTER TABLE comp RENAME TO comp_data; +ALTER TABLE comp_data + DROP COLUMN ehr_id, + DROP COLUMN contribution_id, + DROP COLUMN audit_id, + DROP COLUMN template_id, + DROP COLUMN sys_version, + DROP COLUMN sys_period_lower; + +ALTER TABLE comp_version_history + ADD FOREIGN KEY (ehr_id) REFERENCES ehr (id), + ADD FOREIGN KEY (contribution_id) REFERENCES contribution (id), + ADD FOREIGN KEY (audit_id) REFERENCES audit_details (id), + ADD FOREIGN KEY (template_id) REFERENCES template_store (id); + +alter table comp_history rename to comp_data_history; +ALTER TABLE comp_data_history + DROP COLUMN ehr_id, + DROP COLUMN contribution_id, + DROP COLUMN audit_id, + DROP COLUMN template_id, + DROP COLUMN sys_period_lower, + DROP COLUMN sys_period_upper, + DROP COLUMN sys_deleted; + +ALTER TABLE comp_data + ADD FOREIGN KEY (vo_id) + REFERENCES comp_version (vo_id) + ON DELETE CASCADE; + +ALTER TABLE comp_data_history + ADD FOREIGN KEY (vo_id, sys_version) + REFERENCES comp_version_history (vo_id, sys_version) + ON DELETE CASCADE; + +--EHR_STATUS +ALTER TABLE ehr_status_version + ADD FOREIGN KEY (ehr_id) REFERENCES ehr (id), + ADD FOREIGN KEY (contribution_id) REFERENCES contribution (id), + ADD FOREIGN KEY (audit_id) REFERENCES audit_details (id); + +--FIXME EHR_ID IS PRIMARY KEY; must be added to data tables & set when creating data +ALTER TABLE ehr_status RENAME TO ehr_status_data; +ALTER TABLE ehr_status_data + DROP COLUMN contribution_id, + DROP COLUMN audit_id, + DROP COLUMN sys_version, + DROP COLUMN sys_period_lower; + +ALTER TABLE ehr_status_version_history + ADD FOREIGN KEY (ehr_id) REFERENCES ehr (id), + ADD FOREIGN KEY (contribution_id) REFERENCES contribution (id), + ADD FOREIGN KEY (audit_id) REFERENCES audit_details (id); + +ALTER TABLE ehr_status_history rename to ehr_status_data_history; +ALTER TABLE ehr_status_data_history + DROP COLUMN contribution_id, + DROP COLUMN audit_id, + DROP COLUMN sys_period_lower, + DROP COLUMN sys_period_upper, + DROP COLUMN sys_deleted; + +ALTER TABLE ehr_status_data + ADD FOREIGN KEY (ehr_id) + REFERENCES ehr_status_version (ehr_id) + ON DELETE CASCADE; + +ALTER TABLE ehr_status_data_history + ADD FOREIGN KEY (ehr_id, sys_version) + REFERENCES ehr_status_version_history (ehr_id, sys_version) + ON DELETE CASCADE; + +--EHR Folder +ALTER TABLE ehr_folder_version + ADD FOREIGN KEY (ehr_id) REFERENCES ehr (id), + ADD FOREIGN KEY (contribution_id) REFERENCES contribution (id), + ADD FOREIGN KEY (audit_id) REFERENCES audit_details (id); + +ALTER TABLE ehr_folder RENAME TO ehr_folder_data; +ALTER TABLE ehr_folder_data + DROP COLUMN contribution_id, + DROP COLUMN audit_id, + DROP COLUMN sys_version, + DROP COLUMN sys_period_lower; + +ALTER TABLE ehr_folder_version_history + ADD FOREIGN KEY (ehr_id) REFERENCES ehr (id), + ADD FOREIGN KEY (contribution_id) REFERENCES contribution (id), + ADD FOREIGN KEY (audit_id) REFERENCES audit_details (id); + +alter table ehr_folder_history rename to ehr_folder_data_history; +ALTER TABLE ehr_folder_data_history + DROP COLUMN contribution_id, + DROP COLUMN audit_id, + DROP COLUMN sys_period_lower, + DROP COLUMN sys_period_upper, + DROP COLUMN sys_deleted; + +ALTER TABLE ehr_folder_data + ADD FOREIGN KEY (ehr_id, ehr_folders_idx) + REFERENCES ehr_folder_version (ehr_id, ehr_folders_idx) + ON DELETE CASCADE; + +ALTER TABLE ehr_folder_data_history + ADD FOREIGN KEY (ehr_id, ehr_folders_idx, sys_version) + REFERENCES ehr_folder_version_history (ehr_id, ehr_folders_idx, sys_version) + ON DELETE CASCADE; diff --git a/service/src/main/resources/db/migration/ehr/V6_4__version_tables.sql b/service/src/main/resources/db/migration/ehr/V6_4__version_tables.sql new file mode 100644 index 0000000..a6205b9 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V6_4__version_tables.sql @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +CREATE INDEX comp_data_struc_idx + ON comp_data USING btree + (vo_id, + rm_entity, + entity_concept, + entity_name collate "en_US", + entity_idx) + INCLUDE (entity_idx_cap, entity_idx_len, num); + + +CREATE INDEX comp_data_path_idx + ON comp_data USING btree + (vo_id, + entity_attribute, + entity_idx_len, + rm_entity, + entity_concept, + entity_name collate "en_US" + ) + INCLUDE (entity_idx,entity_idx_cap, num); + + +CREATE INDEX comp_version_ehr_idx + ON comp_version USING btree + (ehr_id, template_id) + INCLUDE (vo_id,sys_version); + + +CREATE INDEX comp_version_template_idx + ON comp_version USING btree + (template_id) + INCLUDE (vo_id,ehr_id,sys_version); + + +CREATE UNIQUE INDEX ehr_status_subject_idx ON ehr_status_data USING btree + (jsonb_extract_path_text(data, VARIADIC ARRAY['su'::text, 'er'::text, 'X'::text, 'V'::text]), + jsonb_extract_path_text(data, VARIADIC ARRAY['su'::text, 'er'::text, 'ns'::text])) + INCLUDE (ehr_id) + WHERE (num = 0); diff --git a/service/src/main/resources/db/migration/ehr/V7__comp_rmobject_index.sql b/service/src/main/resources/db/migration/ehr/V7__comp_rmobject_index.sql new file mode 100644 index 0000000..374073a --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V7__comp_rmobject_index.sql @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +CREATE INDEX comp_data_leaf_idx + ON comp_data (vo_id, entity_idx); diff --git a/service/src/main/resources/db/migration/ehr/V8__vo_data_indexes.sql b/service/src/main/resources/db/migration/ehr/V8__vo_data_indexes.sql new file mode 100644 index 0000000..717d0ac --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V8__vo_data_indexes.sql @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +DROP INDEX comp_data_struc_idx; +DROP INDEX comp_data_path_idx; + +CREATE INDEX comp_data_idx + ON comp_data USING btree + (vo_id, + entity_attribute, + entity_idx_len, + rm_entity, + entity_concept, + entity_name collate "en_US", + entity_idx + ) + INCLUDE (entity_idx_cap, num); + +CREATE INDEX ehr_status_data_idx + ON ehr_status_data USING btree + (ehr_id, + entity_attribute, + entity_idx_len, + rm_entity, + entity_concept, + entity_name collate "en_US", + entity_idx + ) + INCLUDE (vo_id, entity_idx_cap, num); diff --git a/service/src/main/resources/db/migration/ehr/V9_1__add_root_concept_to_comp_version.sql b/service/src/main/resources/db/migration/ehr/V9_1__add_root_concept_to_comp_version.sql new file mode 100644 index 0000000..9a3ab96 --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V9_1__add_root_concept_to_comp_version.sql @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +ALTER TABLE comp_version ADD COLUMN root_concept text; +ALTER TABLE comp_version_history ADD COLUMN root_concept text; diff --git a/service/src/main/resources/db/migration/ehr/V9_2__add_root_concept_to_comp_version.sql b/service/src/main/resources/db/migration/ehr/V9_2__add_root_concept_to_comp_version.sql new file mode 100644 index 0000000..0d35e3c --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V9_2__add_root_concept_to_comp_version.sql @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +UPDATE comp_version v SET root_concept = (SELECT d.entity_concept + FROM comp_data d + WHERE d.vo_id=v.vo_id and d.num = 0); + +UPDATE comp_version_history v SET root_concept = (SELECT d.entity_concept + FROM comp_data_history d + WHERE d.vo_id=v.vo_id and d.num = 0 and d.sys_version=v.sys_version) +where v.sys_deleted = false; diff --git a/service/src/main/resources/db/migration/ehr/V9_3__add_root_concept_to_comp_version.sql b/service/src/main/resources/db/migration/ehr/V9_3__add_root_concept_to_comp_version.sql new file mode 100644 index 0000000..4e727cd --- /dev/null +++ b/service/src/main/resources/db/migration/ehr/V9_3__add_root_concept_to_comp_version.sql @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +ALTER TABLE comp_version ALTER COLUMN root_concept SET NOT NULL; + +CREATE INDEX IF NOT EXISTS comp_version_root_concept_idx + ON comp_version USING btree + (ehr_id, root_concept) + INCLUDE(vo_id, sys_version); diff --git a/service/src/main/resources/db/migration/ext/V1__baseline.sql b/service/src/main/resources/db/migration/ext/V1__baseline.sql new file mode 100644 index 0000000..d639664 --- /dev/null +++ b/service/src/main/resources/db/migration/ext/V1__baseline.sql @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +--empty diff --git a/service/src/main/resources/db/migration/ext/V2__aggregate_functions.sql b/service/src/main/resources/db/migration/ext/V2__aggregate_functions.sql new file mode 100644 index 0000000..12a65e1 --- /dev/null +++ b/service/src/main/resources/db/migration/ext/V2__aggregate_functions.sql @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +-- max() for jsonb +CREATE OR REPLACE FUNCTION jsonb_larger(j1 jsonb, j2 jsonb) + RETURNS jsonb AS $$ +BEGIN + IF j1 > j2 THEN + RETURN j1; + ELSE + RETURN j2; + END IF; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE AGGREGATE max(jsonb)( + SFUNC = jsonb_larger, + STYPE = jsonb , + FINALFUNC_MODIFY = READ_ONLY, + COMBINEFUNC = jsonb_larger, + MFINALFUNC_MODIFY = READ_ONLY, + SORTOP = >, + PARALLEL = SAFE + ); + +-- min() for jsonb +CREATE OR REPLACE FUNCTION jsonb_smaller(j1 jsonb, j2 jsonb) + RETURNS jsonb AS $$ +BEGIN + IF j1 < j2 THEN + RETURN j1; + ELSE + RETURN j2; + END IF; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE AGGREGATE min(jsonb)( + SFUNC = jsonb_smaller, + STYPE = jsonb , + FINALFUNC_MODIFY = READ_ONLY, + COMBINEFUNC = jsonb_smaller, + MFINALFUNC_MODIFY = READ_ONLY, + SORTOP = <, + PARALLEL = SAFE + ); + +-- avg() for jsonb + +CREATE OR REPLACE FUNCTION jsonb_avg_acc(s numeric[], j2 jsonb) + RETURNS numeric[] AS $$ +BEGIN + IF jsonb_typeof(j2) = 'number'::text THEN + RETURN s || j2::numeric; + ELSE + RETURN s; + END IF; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION jsonb_avg_combine(s1 numeric[], s2 numeric[]) + RETURNS numeric[] AS $$ +BEGIN + RETURN s1 || s2; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION jsonb_avg(s numeric[]) + RETURNS jsonb AS $$ +DECLARE + len numeric; + sum numeric := 0; + x numeric; +BEGIN + len := COALESCE(array_length(s,1),0)::numeric; + IF len > 0 THEN + FOREACH x IN ARRAY s LOOP + sum := sum + x; + END LOOP; + RETURN to_jsonb(sum/len); + ELSE + RETURN NULL; + END IF; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE AGGREGATE avg(jsonb)( + SFUNC = jsonb_avg_acc, + STYPE = numeric[] , + FINALFUNC = jsonb_avg, + FINALFUNC_MODIFY = READ_ONLY, + COMBINEFUNC = jsonb_avg_combine, + INITCOND = '{}', + MFINALFUNC_MODIFY = READ_ONLY, + PARALLEL = SAFE + ); + +-- sum() for jsonb + +CREATE OR REPLACE FUNCTION jsonb_sum(s numeric[]) + RETURNS jsonb AS $$ +DECLARE + sum numeric := 0; + x numeric; +BEGIN + IF COALESCE(array_length(s,1),0) > 0 THEN + FOREACH x IN ARRAY s LOOP + sum := sum + x; + END LOOP; + RETURN to_jsonb(sum); + ELSE + RETURN NULL; + END IF; +END; +$$ + language plpgsql + IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE AGGREGATE sum(jsonb)( + SFUNC = jsonb_avg_acc, + STYPE = numeric[], + FINALFUNC = jsonb_sum, + FINALFUNC_MODIFY = READ_ONLY, + COMBINEFUNC = jsonb_avg_combine, + INITCOND = '{}', + MFINALFUNC_MODIFY = READ_ONLY, + PARALLEL = SAFE + ); diff --git a/service/src/main/resources/db/migration/ext/V3__dv_ordered_aggregate_functions.sql b/service/src/main/resources/db/migration/ext/V3__dv_ordered_aggregate_functions.sql new file mode 100644 index 0000000..d13011e --- /dev/null +++ b/service/src/main/resources/db/migration/ext/V3__dv_ordered_aggregate_functions.sql @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +-- Function for getting the magnitude() of DV_ORDERED +CREATE OR REPLACE FUNCTION jsonb_dv_ordered_magnitude(dv jsonb) + RETURNS jsonb AS $$ +BEGIN + CASE dv ->> 'T' + WHEN 'q', 'co' THEN + RETURN dv -> 'm'; + WHEN 'pr', 't', 'd', 'dt', 'du' THEN + RETURN dv -> 'M'; + WHEN 'sc', 'o' THEN + RETURN dv -> 'V'; + ELSE + RETURN null; + END CASE; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE + STRICT + PARALLEL SAFE; + +--max() for DV_ORDERED jsonb +CREATE OR REPLACE FUNCTION dv_ordered_larger(j1 jsonb, j2 jsonb) + RETURNS jsonb AS $$ +DECLARE + m1 jsonb:= jsonb_dv_ordered_magnitude(j1); + m2 jsonb:= jsonb_dv_ordered_magnitude(j2); + cond boolean := m1 > m2; +BEGIN + IF cond THEN + RETURN j1; + ELSEIF cond IS NOT NULL THEN + RETURN j2; + ELSEIF m1 IS NOT NULL THEN + RETURN j1; + ELSEIF m2 IS NOT NULL THEN + RETURN j2; + ELSE + RETURN NULL; + END IF; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE + PARALLEL SAFE; + +CREATE OR REPLACE AGGREGATE max_dv_ordered(jsonb)( + SFUNC = dv_ordered_larger, + STYPE = jsonb, + FINALFUNC_MODIFY = READ_ONLY, + COMBINEFUNC = dv_ordered_larger, + MFINALFUNC_MODIFY = READ_ONLY, + SORTOP = >, + PARALLEL = SAFE + ); + +-- min() for DV_ORDERED jsonb +CREATE OR REPLACE FUNCTION dv_ordered_smaller(j1 jsonb, j2 jsonb) + RETURNS jsonb AS $$ +DECLARE + m1 jsonb:= jsonb_dv_ordered_magnitude(j1); + m2 jsonb:= jsonb_dv_ordered_magnitude(j2); + cond boolean := m1 < m2; +BEGIN + IF cond THEN + RETURN j1; + ELSEIF cond IS NOT NULL THEN + RETURN j2; + ELSEIF m1 IS NOT NULL THEN + RETURN j1; + ELSEIF m2 IS NOT NULL THEN + RETURN j2; + ELSE + RETURN NULL; + END IF; +END; +$$ + LANGUAGE plpgsql + IMMUTABLE + PARALLEL SAFE; + +CREATE OR REPLACE AGGREGATE min_dv_ordered(jsonb)( + SFUNC = dv_ordered_smaller, + STYPE = jsonb, + FINALFUNC_MODIFY = READ_ONLY, + COMBINEFUNC = dv_ordered_smaller, + MFINALFUNC_MODIFY = READ_ONLY, + SORTOP = <, + PARALLEL = SAFE + ); \ No newline at end of file diff --git a/service/src/main/resources/db/migration/ext/V4__create_missing_collation.sql b/service/src/main/resources/db/migration/ext/V4__create_missing_collation.sql new file mode 100644 index 0000000..415f78c --- /dev/null +++ b/service/src/main/resources/db/migration/ext/V4__create_missing_collation.sql @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 vitasystems GmbH. + * + * This file is part of project EHRbase + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific LANGUAGE governing permissions and + * limitations under the License. + */ + +-- since the libc locales depend on what the operating system provides we ensure there always is a "en_US" collation using icu +CREATE COLLATION IF NOT EXISTS "en_US" (provider = icu, locale = 'en-US'); diff --git a/service/src/test/java/org/ehrbase/migration/service/BatchTest.java b/service/src/test/java/org/ehrbase/migration/service/BatchTest.java new file mode 100644 index 0000000..bd1bd6b --- /dev/null +++ b/service/src/test/java/org/ehrbase/migration/service/BatchTest.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.ehrbase.migration.service; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.util.List; +import java.util.stream.IntStream; +import org.junit.jupiter.api.Test; + +class BatchTest { + + @Test + void page() { + assertThat(Batch.page(0, 10, 100)).isEqualTo(new Batch(0, 10)); + assertThat(Batch.page(1, 10, 100)).isEqualTo(new Batch(10, 10)); + assertThat(Batch.page(9, 10, 100)).isEqualTo(new Batch(90, 10)); + assertThatThrownBy(() -> Batch.page(-1, 10, 100)).isInstanceOf(IndexOutOfBoundsException.class); + assertThatThrownBy(() -> Batch.page(10, 10, 100)).isInstanceOf(IndexOutOfBoundsException.class); + + assertThat(Batch.page(0, 10, 1)).isEqualTo(new Batch(0, 1)); + assertThat(Batch.page(0, 10, 9)).isEqualTo(new Batch(0, 9)); + assertThat(Batch.page(9, 10, 91)).isEqualTo(new Batch(90, 1)); + assertThat(Batch.page(9, 10, 99)).isEqualTo(new Batch(90, 9)); + } + + @Test + void stream() { + assertThat(Batch.stream(1, 0)).isEmpty(); + assertThat(Batch.stream(1, 1)).containsExactly(new Batch(0, 1)); + assertThat(Batch.stream(10, 10)).containsExactly(new Batch(0, 10)); + assertThat(Batch.stream(10, 9)).containsExactly(new Batch(0, 9)); + assertThat(Batch.stream(10, 30)).containsExactly(new Batch(0, 10), new Batch(10, 10), new Batch(20, 10)); + assertThat(Batch.stream(10, 29)).containsExactly(new Batch(0, 10), new Batch(10, 10), new Batch(20, 9)); + } + + @Test + void streamParallel() { + List pageStarts = IntStream.range(0, 100).mapToObj(i -> 10 * i).toList(); + assertThat(Batch.stream(10, 999).map(Batch::start)).containsExactlyInAnyOrderElementsOf(pageStarts); + } + + @Test + void calcEndInclusive() { + assertThat(new Batch(0, 1).calcEndInclusive()).isEqualTo(0); + assertThat(new Batch(7, 9).calcEndInclusive()).isEqualTo(15); + assertThat(new Batch(90, 10).calcEndInclusive()).isEqualTo(99); + } +} diff --git a/spotless-lic-header b/spotless-lic-header new file mode 100644 index 0000000..c3415b1 --- /dev/null +++ b/spotless-lic-header @@ -0,0 +1,17 @@ +/* + * Copyright (c) $YEAR vitasystems GmbH + * + * This file is part of project EHRbase Migration Tool + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */