Skip to content

Commit

Permalink
fix: resolve unbuild pmsi criteria always return all hierarchy
Browse files Browse the repository at this point in the history
* fix: adapt documentReference params type to type-name

* refactor: change type sort by type-name in dataTableComposition

* refactor: change type sort by type-name in dataTableComposition

* fix: resolve repartitionMap for graph

* fix: resolve unbuild pmsi criteria always return all hierarchy
  • Loading branch information
Mehdi-BOUYAHIA authored Oct 25, 2023
1 parent 0e0bf60 commit 6509909
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions src/utils/cohortCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,15 @@ export async function unbuildRequest(_json: string): Promise<any> {
const key = filter ? filter[0] : null
const value = filter ? filter[1] : null
switch (key) {
case CONDITION_CODE_ALL_HIERARCHY:
currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, { id: '*' }] : { id: '*' }
break
case CONDITION_CODE: {
const codeIds = value?.split(',')
const newCode = codeIds?.map((codeId: any) => ({ id: codeId }))
const newCode = codeIds?.map((codeId: any) => {
codeId = codeId.split('|')
if (codeId.length > 1) {
return { id: codeId[1] }
}
return { id: codeId[0] }
})
if (!newCode) continue

currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, ...newCode] : newCode
Expand Down Expand Up @@ -1232,12 +1235,15 @@ export async function unbuildRequest(_json: string): Promise<any> {
const key = filter ? filter[0] : null
const value = filter ? filter[1] : null
switch (key) {
case PROCEDURE_CODE_ALL_HIERARCHY:
currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, { id: '*' }] : { id: '*' }
break
case PROCEDURE_CODE: {
const codeIds = value?.split(',')
const newCode = codeIds?.map((codeId: any) => ({ id: codeId }))
const newCode = codeIds?.map((codeId: any) => {
codeId = codeId.split('|')
if (codeId.length > 1) {
return { id: codeId[1] }
}
return { id: codeId[0] }
})
if (!newCode) continue

currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, ...newCode] : newCode
Expand Down Expand Up @@ -1293,12 +1299,15 @@ export async function unbuildRequest(_json: string): Promise<any> {
const key = filter ? filter[0] : null
const value = filter ? filter[1] : null
switch (key) {
case CLAIM_CODE_ALL_HIERARCHY:
currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, { id: '*' }] : { id: '*' }
break
case CLAIM_CODE: {
const codeIds = value?.split(',')
const newCode = codeIds?.map((codeId: any) => ({ id: codeId }))
const newCode = codeIds?.map((codeId: any) => {
codeId = codeId.split('|')
if (codeId.length > 1) {
return { id: codeId[1] }
}
return { id: codeId[0] }
})
if (!newCode) continue

currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, ...newCode] : newCode
Expand Down Expand Up @@ -1446,12 +1455,15 @@ export async function unbuildRequest(_json: string): Promise<any> {
const value = filter ? filter[1] : null

switch (key) {
case OBSERVATION_CODE_ALL_HIERARCHY:
currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, { id: '*' }] : { id: '*' }
break
case OBSERVATION_CODE: {
const codeIds = value?.split(',')
const newCode = codeIds?.map((codeId: any) => ({ id: codeId }))
const newCode = codeIds?.map((codeId: any) => {
codeId = codeId.split('|')
if (codeId.length > 1) {
return { id: codeId[1] }
}
return { id: codeId[0] }
})
if (!newCode) continue

currentCriterion.code = currentCriterion.code ? [...currentCriterion.code, ...newCode] : newCode
Expand Down

0 comments on commit 6509909

Please sign in to comment.