Skip to content

Commit

Permalink
Merge pull request #60 from fair4health/v1.2.3
Browse files Browse the repository at this point in the history
V1.2.3
  • Loading branch information
sinaci authored Apr 28, 2021
2 parents 5106af7 + 950a724 commit 7e85dd6
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ The tool writes logs to the following locations:
- on **Linux**: `~/.config/FAIR4Health Data Curation Tool/logs/log.txt`

## Terminology Server Connection
The tool is compatible with FHIR based Terminology Servers, in order to translate values from one system to another. As the sample API https://terminology-service.atosresearch.eu provided by ATOS was used.
The tool is compatible with FHIR based Terminology Servers, in order to translate values from one system to another.
As the sample API `https://health-digital-term.ari-health.eu` provided by ATOS was used.

Currently, in the tool:
- For the translation operation, the ConceptMap translate API: `/ConceptMap/$translate` is consumed.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fair4health-data-curation-tool",
"productName": "FAIR4Health Data Curation Tool",
"version": "1.2.2",
"version": "1.2.3",
"private": true,
"author": "SRDC Corporation <[email protected]>",
"description": "FAIR4Health | Data Curation and Validation Tool",
Expand Down
5 changes: 5 additions & 0 deletions src/common/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
const onfhirBase = 'http://localhost:8080/fhir'
const hl7Base = 'http://hl7.org/fhir'

// The url representing how many resources created during transformation
// Placed in the extension part of the Provenance and DocumentManifest resources
const numberOfResourcesUrlBase = `${hl7Base}/f4h/resource-count`

export let environment = {
toolID: 'data-curation-tool',
server: {
Expand All @@ -19,6 +23,7 @@ export let environment = {
databaseTypes: ['postgres'],
hl7: hl7Base,
FHIRBatchOperationSize: 1000,
numberOfResourcesUrlBase,
codesystems: {
ATC: 'http://www.whocc.no/atc',
SNOMED: 'http://snomed.info/sct',
Expand Down
8 changes: 8 additions & 0 deletions src/common/utils/fhir-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ export class FHIRUtil {
}
}

/**
* Removes the trailing slash in the url
* @param url
*/
static trimUrl (url: string): string {
return (url || '').replace(/\/$/, '')
}

private static readonly secretKey: string = 'E~w*c`r8e?aetZeid]b$y+aIl&p4eNr*a'

}
17 changes: 17 additions & 0 deletions src/components/BackgroundEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,12 +1057,29 @@ export default class BackgroundEngine extends Vue {
*/
createProvenanceAndLicense (author: string, license: License, provenanceTargets: fhir.Reference[], documentManifestContent: fhir.Reference[]): Promise<void> {
const currentDate: string = new Date().toISOString()
const resourceCounts = provenanceTargets.reduce((acc, currReference) => {
const reference = currReference.reference.split('/')[0]
if (!acc.hasOwnProperty(reference)) {
acc[reference] = 0
}
acc[reference]++
return acc
}, {})
const extension: fhir.Extension[] = []
Object.keys(resourceCounts).map((resourceType: string) => {
extension.push({
url: `${environment.numberOfResourcesUrlBase}/${resourceType}`,
valueInteger: resourceCounts[resourceType]
})
})
// Modify provenance resource
this.provenance.extension = extension
this.provenance.target = provenanceTargets
this.provenance.recorded = currentDate
this.provenance.signature[0].when = currentDate
this.provenance.agent[0].who.display = author
// Modify documentManifest resource
this.documentManifest.extension = extension
this.documentManifest.content = documentManifestContent
this.documentManifest.created = currentDate
this.documentManifest.related[0].ref.display = license.display
Expand Down
3 changes: 2 additions & 1 deletion src/components/CodeSystemSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import { Component, Vue, Prop } from 'vue-property-decorator'
import { environment } from '@/common/environment'
import { VuexStoreUtil as types } from '@/common/utils/vuex-store-util'
import {FHIRUtil} from '@/common/utils/fhir-util'
@Component
export default class CodeSystemSelect extends Vue {
Expand All @@ -54,7 +55,7 @@
}
updateUrl (val: string) {
this.url = val?.trim() || ''
this.url = FHIRUtil.trimUrl(val?.trim() || '')
this.$emit('input', this.url)
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/OnFHIRConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<q-item-label class="text-weight-bold q-mb-lg">
<span class="text-primary"><q-icon name="fas fa-info" size="xs" class="q-mr-xs" /> {{ $t('LABELS.PROVIDE_FHIR_URL') }} </span>
</q-item-label>
<q-input outlined square dense type="url" class="col-10" v-model="onfhirBaseUrl" color="primary"
<q-input outlined square dense type="url" class="col-10" v-model.lazy.trim="onfhirBaseUrl" color="primary"
@input="fhirBaseVerificationStatus = Status.PENDING"
:placeholder="$t('LABELS.FHIR_REPOSITORY_URL')"
:disable="isInProgress(fhirBaseVerificationStatus)"
Expand Down Expand Up @@ -64,6 +64,7 @@
import Status from '@/common/Status'
import StatusMixin from '@/common/mixins/statusMixin'
import Loading from '@/components/Loading.vue'
import {FHIRUtil} from '@/common/utils/fhir-util'
@Component({
components: {
Expand Down Expand Up @@ -96,6 +97,7 @@
verifyFhir () {
if (this.onfhirBaseUrl) {
this.onfhirBaseUrl = FHIRUtil.trimUrl(this.onfhirBaseUrl)
this.fhirBaseVerificationStatus = Status.IN_PROGRESS
this.$store.dispatch(types.Fhir.VERIFY_FHIR, this.onfhirBaseUrl)
.then(() => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/TerminologyConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<q-item-label class="text-weight-bold q-mb-lg text-primary text-h6">
{{ $t('LABELS.ADD_TERMINOLOGY_SERVICE') }}
</q-item-label>
<q-input outlined dense type="url" class="col-10" v-model="terminologyBaseUrl" color="primary"
<q-input outlined dense type="url" class="col-10" v-model.lazy.trim="terminologyBaseUrl" color="primary"
@input="tBaseVerificationStatus = Status.PENDING"
:placeholder="$t('LABELS.TERMINOLOGY_SERVICE_URL')"
:disable="isInProgress(tBaseVerificationStatus)"
Expand Down Expand Up @@ -40,6 +40,7 @@
import Status from '@/common/Status'
import { IpcChannelUtil as ipcChannels } from '@/common/utils/ipc-channel-util'
import { ipcRenderer } from 'electron'
import {FHIRUtil} from '@/common/utils/fhir-util'
@Component
export default class TerminologyConfig extends Mixins(StatusMixin) {
Expand All @@ -58,6 +59,7 @@
verifyTerminology () {
if (this.terminologyBaseUrl) {
this.terminologyBaseUrl = FHIRUtil.trimUrl(this.terminologyBaseUrl)
this.tBaseVerificationStatus = Status.IN_PROGRESS
this.$store.dispatch(types.Terminology.VERIFY_TERMINOLOGY, this.terminologyBaseUrl)
.then(() => {
Expand Down

0 comments on commit 7e85dd6

Please sign in to comment.