Skip to content

Commit

Permalink
identifiedPath use path and root
Browse files Browse the repository at this point in the history
  • Loading branch information
mafasva committed May 22, 2024
1 parent 59afef2 commit 94bc1d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
8 changes: 3 additions & 5 deletions src/app/shared/models/aqb/aqb-select-item-ui.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class AqbSelectItemUiModel {
this.name = item.name || item.archetypeId
this.givenName = ''
this.rmType = item.rmType
this.aqlPath = item.aqlPath || ''
this.aqlPath = (item.aqlPath || '').replace(/^\//, '')
this.humanReadablePath = item.humanReadablePath
this.compositionReferenceId = compositionReferenceId
this.archetypeReferenceId = archetypeReferenceId
Expand All @@ -39,10 +39,8 @@ export class AqbSelectItemUiModel {
_type: AqbNodeType.SelectExpression,
columnExpression: {
_type: AqbNodeType.IdentifiedPath,
root: {
_type: 'Containment',
identifier: `${this.isComposition ? 'c' : 'o'}${this.archetypeReferenceId}${this.aqlPath}`,
},
root: `${this.isComposition ? 'c' : 'o'}${this.archetypeReferenceId}`,
path: this.aqlPath,
},
...(this.givenName && { alias: this.givenName }),
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/models/aqb/aqb-where-item-ui.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class AqbWhereItemUiModel {
this.givenName = item.name || item.archetypeId
this.rmType = item.rmType
this.identifier = identifier
this.aqlPath = this.configurePath(item.aqlPath || '')
this.aqlPath = this.configurePath(item.aqlPath || '').replace(/^\//, '')
this.humanReadablePath = item.humanReadablePath
this.compositionReferenceId = compositionReferenceId
this.archetypeReferenceId = archetypeReferenceId
Expand Down Expand Up @@ -174,7 +174,8 @@ export class AqbWhereItemUiModel {
convertFieldToApi(): IAqbIdentifiedPathValueNode {
return {
_type: AqbNodeType.IdentifiedPath,
root: { _type: 'Containment', identifier: this.identifier + this.aqlPath },
root: this.identifier,
path: this.aqlPath,
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export interface IAqbIdentifiedPathValueNode {
*/
_type: AqbNodeType.IdentifiedPath

root: {
_type: 'Containment'
// necessary, because backend (openEhrSDK) not allow to add path with JSON
identifier: string
}
path: string

root: string
}

0 comments on commit 94bc1d7

Please sign in to comment.