Skip to content

Commit

Permalink
fix(questionnaireResponse): add new boolean field data type
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-buiquang committed Mar 26, 2024
1 parent 2d031f3 commit 8b44a2e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
13 changes: 12 additions & 1 deletion src/data/questionnaire_data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const booleanFieldsData = [
export const booleanOpenChoiceFieldsData = [
{
id: 'Oui',
label: 'Oui'
Expand All @@ -9,6 +9,17 @@ export const booleanFieldsData = [
}
]

export const booleanFieldsData = [
{
id: 'true',
label: 'Oui'
},
{
id: 'false',
label: 'Non'
}
]

export const vmeData = [
{
id: 'Non faite',
Expand Down
10 changes: 5 additions & 5 deletions src/services/aphp/serviceCohortCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
import { fetchSingleCodeHierarchy, fetchValueSet } from './callApi'
import { DocType } from 'types/requestCriterias'
import { VitalStatusLabel } from 'types/searchCriterias'
import { birthStatusData, booleanFieldsData, vmeData } from 'data/questionnaire_data'
import { birthStatusData, booleanFieldsData, booleanOpenChoiceFieldsData, vmeData } from 'data/questionnaire_data'

export interface IServiceCohortCreation {
/**
Expand Down Expand Up @@ -475,21 +475,21 @@ const servicesCohortCreation: IServiceCohortCreation = {
return booleanFieldsData
},
fetchInUteroTransfer: async () => {
return booleanFieldsData
return booleanOpenChoiceFieldsData
},
fetchPregnancyMonitoring: async () => {
return booleanFieldsData
},
fetchMaturationCorticotherapie: async () => {
return booleanFieldsData
return booleanOpenChoiceFieldsData
},
fetchChirurgicalGesture: async () =>
fetchValueSet(CHIRURGICAL_GESTURE, { joinDisplayWithCode: false, sortingKey: 'id' }),
fetchVme: async () => {
return vmeData
},
fetchChildbirth: async () => {
return booleanFieldsData
return booleanOpenChoiceFieldsData
},
fetchHospitalChildBirthPlace: async () => {
return booleanFieldsData
Expand Down Expand Up @@ -523,7 +523,7 @@ const servicesCohortCreation: IServiceCohortCreation = {
return birthStatusData
},
fetchSetPostpartumHemorrhage: async () => {
return booleanFieldsData
return booleanOpenChoiceFieldsData
},
fetchConditionPerineum: async () =>
fetchValueSet(CONDITION_PERINEUM, { joinDisplayWithCode: false, sortingKey: 'id' }),
Expand Down

0 comments on commit 8b44a2e

Please sign in to comment.