Skip to content

Commit f3ac179

Browse files
committed
correc rebase
1 parent 1974ff5 commit f3ac179

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

src/components/Patient/PatientForms/MaternityForms/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ import services from 'services/aphp'
2323
import { SourceType } from 'types/scope'
2424
import { useSearchParams } from 'react-router-dom'
2525
import { getCleanGroupId } from 'utils/paginationUtils'
26-
<<<<<<< HEAD
2726
import { getCodeList } from 'services/aphp/serviceValueSets'
2827
import { getConfig } from 'config'
29-
=======
3028
import MultiSelectInput from 'components/Filters/MultiSelectInput'
31-
>>>>>>> 3de84b27 (ref: 2490-refacto filters - Ref gestion-de-projet#2371)
3229

3330
const MaternityForm = () => {
3431
const [toggleModal, setToggleModal] = useState(false)

src/services/aphp/callApi.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,44 @@ export const fetchAccessExpirations: (
10971097
return response
10981098
}
10991099

1100+
type fetchDiagnosticReportProps = {
1101+
_elements?: string[]
1102+
size?: number
1103+
offset?: number
1104+
code?: string
1105+
date?: string
1106+
patient?: string[]
1107+
study?: string[]
1108+
encounter?: string[]
1109+
_list?: string[]
1110+
signal?: AbortSignal
1111+
}
1112+
export const fetchDiagnosticReport = async (args: fetchDiagnosticReportProps) => {
1113+
const { _list, _elements, code, date, patient, study, encounter, size, offset, signal } = args
1114+
const config = getConfig()
1115+
1116+
let options: string[] = []
1117+
if (size !== undefined) options = [...options, `_count=${size}`]
1118+
if (offset) options = [...options, `_offset=${offset}`]
1119+
if (config.features.diagnosticReport.useStudyParam && study)
1120+
options = [...options, `study=${study.reduce(paramValuesReducer, '')}`]
1121+
if (encounter) options = [...options, `encounter=${encounter.reduce(paramValuesReducer, '')}`]
1122+
if (patient) options = [...options, `patient=${patient.reduce(paramValuesReducer, '')}`]
1123+
if (date) options = [...options, `date=${date}`]
1124+
if (code) options = [...options, `code=${code}`]
1125+
if (_elements && _elements.length > 0)
1126+
options = [...options, `_elements=${_elements.filter(uniq).reduce(paramValuesReducer, '')}`]
1127+
1128+
if (_list && _list.length > 0) options = [...options, `_list=${_list.filter(uniq).reduce(paramValuesReducer, '')}`]
1129+
1130+
const queryString = options.length > 0 ? `?${options.reduce(paramsReducer, '')}` : ''
1131+
const response = await apiFhir.get<FHIR_Bundle_Response<DiagnosticReport>>(`/DiagnosticReport${queryString}`, {
1132+
signal
1133+
})
1134+
1135+
return response
1136+
}
1137+
11001138
export const fetchPerimeterAccesses = async (perimeter: string): Promise<AxiosResponse<DataRights[]>> => {
11011139
const response = await apiBackend.get<DataRights[]>(`accesses/accesses/my-data-rights/?perimeters_ids=${perimeter}`)
11021140
return response

0 commit comments

Comments
 (0)