Skip to content

Commit

Permalink
correc rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
aetchego committed Dec 11, 2024
1 parent 1974ff5 commit f3ac179
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/components/Patient/PatientForms/MaternityForms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ import services from 'services/aphp'
import { SourceType } from 'types/scope'
import { useSearchParams } from 'react-router-dom'
import { getCleanGroupId } from 'utils/paginationUtils'
<<<<<<< HEAD
import { getCodeList } from 'services/aphp/serviceValueSets'
import { getConfig } from 'config'
=======
import MultiSelectInput from 'components/Filters/MultiSelectInput'
>>>>>>> 3de84b27 (ref: 2490-refacto filters - Ref gestion-de-projet#2371)

const MaternityForm = () => {
const [toggleModal, setToggleModal] = useState(false)
Expand Down
38 changes: 38 additions & 0 deletions src/services/aphp/callApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,44 @@ export const fetchAccessExpirations: (
return response
}

type fetchDiagnosticReportProps = {
_elements?: string[]
size?: number
offset?: number
code?: string
date?: string
patient?: string[]
study?: string[]
encounter?: string[]
_list?: string[]
signal?: AbortSignal
}
export const fetchDiagnosticReport = async (args: fetchDiagnosticReportProps) => {
const { _list, _elements, code, date, patient, study, encounter, size, offset, signal } = args
const config = getConfig()

let options: string[] = []
if (size !== undefined) options = [...options, `_count=${size}`]
if (offset) options = [...options, `_offset=${offset}`]
if (config.features.diagnosticReport.useStudyParam && study)
options = [...options, `study=${study.reduce(paramValuesReducer, '')}`]
if (encounter) options = [...options, `encounter=${encounter.reduce(paramValuesReducer, '')}`]
if (patient) options = [...options, `patient=${patient.reduce(paramValuesReducer, '')}`]
if (date) options = [...options, `date=${date}`]
if (code) options = [...options, `code=${code}`]
if (_elements && _elements.length > 0)
options = [...options, `_elements=${_elements.filter(uniq).reduce(paramValuesReducer, '')}`]

if (_list && _list.length > 0) options = [...options, `_list=${_list.filter(uniq).reduce(paramValuesReducer, '')}`]

const queryString = options.length > 0 ? `?${options.reduce(paramsReducer, '')}` : ''
const response = await apiFhir.get<FHIR_Bundle_Response<DiagnosticReport>>(`/DiagnosticReport${queryString}`, {
signal
})

return response
}

export const fetchPerimeterAccesses = async (perimeter: string): Promise<AxiosResponse<DataRights[]>> => {
const response = await apiBackend.get<DataRights[]>(`accesses/accesses/my-data-rights/?perimeters_ids=${perimeter}`)
return response
Expand Down

0 comments on commit f3ac179

Please sign in to comment.