Skip to content

Commit

Permalink
fix: changed size to _count in all fhir resources - Ref gestion-de-pr…
Browse files Browse the repository at this point in the history
…ojet#2148
  • Loading branch information
ManelleG committed Jun 29, 2023
1 parent ed8e75b commit 247c9cf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions src/services/aphp/callApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const fetchEncounter = async (args: fetchEncounterProps) => {
// By default, all the calls to `/Encounter` will have '_has:Patient:encounter:active=true' in parameter
let options: string[] = ['_has:Patient:encounter:active=true']
if (_id) options = [...options, `_id=${_id}`] // eslint-disable-line
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (patient) options = [...options, `subject=${patient}`] // eslint-disable-line
Expand Down Expand Up @@ -273,7 +273,7 @@ export const fetchComposition = async (args: fetchCompositionProps) => {
// By default, all the calls to `/DocumentReference` will have `type:not=doc-impor`, empty=false, and patient-active=true in parameter
let options: string[] = ['type:not=doc-impor', 'empty=false', 'patient-active=true']
if (_id) options = [...options, `_id=${_id}`] // eslint-disable-line
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`]
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (type) options = [...options, `type=${type}`] // eslint-disable-line
Expand Down Expand Up @@ -377,7 +377,7 @@ export const fetchProcedure = async (args: fetchProcedureProps) => {

// By default, all the calls to `/Procedure` will have 'patient-active=true' in parameter
let options: string[] = ['patient-active=true']
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (subject) options = [...options, `subject=${subject}`] // eslint-disable-line
Expand Down Expand Up @@ -426,7 +426,7 @@ export const fetchClaim = async (args: fetchClaimProps) => {

// By default, all the calls to `/Claim` will have 'patient-active=true' in parameter
let options: string[] = ['patient-active=true']
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (subject) options = [...options, `subject=${subject}`] // eslint-disable-line
Expand Down Expand Up @@ -479,7 +479,7 @@ export const fetchCondition = async (args: fetchConditionProps) => {

// By default, all the calls to `/Condition` will have 'patient-active=true' in parameter
let options: string[] = ['patient-active=true']
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (subject) options = [...options, `subject=${subject}`] // eslint-disable-line
Expand Down Expand Up @@ -541,7 +541,7 @@ export const fetchObservation = async (args: fetchObservationProps) => {
// By default, all the calls to `/Observation` will have 'value-quantity-value=ge0,le0' and 'patient-active=true' in the parameters
let options: string[] = ['value-quantity-value=ge0,le0', 'patient-active=true']
if (id) options = [...options, `id=${id}`] // eslint-disable-line
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort.includes('code') ? _sort : `${_sort},id`}`] // eslint-disable-line
if (_text) options = [...options, `_text=${encodeURIComponent(_text)}`] // eslint-disable-line
Expand Down Expand Up @@ -584,7 +584,7 @@ export const fetchMedicationRequest = async (args: fetchMedicationRequestProps)
// By default, all the calls to `/MedicationRequest` will have 'patient-active=true' in parameter
let options: string[] = ['patient-active=true']
if (id) options = [...options, `id=${id}`] // eslint-disable-line
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (patient) options = [...options, `patient=${patient}`] // eslint-disable-line
Expand Down Expand Up @@ -627,7 +627,7 @@ export const fetchMedicationAdministration = async (args: fetchMedicationAdminis
// By default, all the calls to `/MedicationAdministration` will have 'patient-active=true' in parameter
let options: string[] = ['patient-active=true']
if (id) options = [...options, `id=${id}`] // eslint-disable-line
if (size !== undefined) options = [...options, `size=${size}`] // eslint-disable-line
if (size !== undefined) options = [...options, `_count=${size}`] // eslint-disable-line
if (offset) options = [...options, `offset=${offset}`] // eslint-disable-line
if (_sort) options = [...options, `_sort=${_sortDirection}${_sort},id`] // eslint-disable-line
if (patient) options = [...options, `patient=${patient}`] // eslint-disable-line
Expand Down
2 changes: 1 addition & 1 deletion src/services/aphp/cohortCreation/fetchClaim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const fetchGhmData = async (searchValue?: string, noStar?: boolean) => {
? `&_text=${encodeURIComponent(searchValue.trim().replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'))}*` //eslint-disable-line
: ''

const res = await apiFhir.get<any>(`/ValueSet?url=${CLAIM_HIERARCHY}${_searchValue}&size=${VALUE_SET_SIZE ?? 9999}`)
const res = await apiFhir.get<any>(`/ValueSet?url=${CLAIM_HIERARCHY}${_searchValue}&_count=${VALUE_SET_SIZE ?? 9999}`)

const data =
res && res.data && res.data.entry && res.data.entry[0] && res.data.resourceType === 'Bundle'
Expand Down
2 changes: 1 addition & 1 deletion src/services/aphp/cohortCreation/fetchCondition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const fetchCim10Diagnostic = async (searchValue?: string, noStar?: boolea
: ''

const res = await apiFhir.get<any>(
`/ValueSet?url=${CONDITION_HIERARCHY}${_searchValue}&size=${VALUE_SET_SIZE ?? 9999}`
`/ValueSet?url=${CONDITION_HIERARCHY}${_searchValue}&_count=${VALUE_SET_SIZE ?? 9999}`
)

let cim10List =
Expand Down
4 changes: 2 additions & 2 deletions src/services/aphp/cohortCreation/fetchMedication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const fetchAtcData = async (searchValue?: string, noStar?: boolean) => {
: ''

const res = await apiFhir.get<FHIR_API_Response<ValueSet>>(
`/ValueSet?url=${MEDICATION_ATC}${_searchValue}&size=${VALUE_SET_SIZE ?? 9999}`
`/ValueSet?url=${MEDICATION_ATC}${_searchValue}&_count=${VALUE_SET_SIZE ?? 9999}`
)

const resources = getApiResponseResources(res)
Expand Down Expand Up @@ -106,7 +106,7 @@ export const fetchAtcHierarchy = async (atcParent: string) => {

export const fetchSignleCode: (code: string) => Promise<string[]> = async (code: string) => {
if (!code) return []
const response = await apiFhir.get<any>(`/ConceptMap?size=100&context=Descendant-leaf&source-code=${code}`)
const response = await apiFhir.get<any>(`/ConceptMap?_count=100&context=Descendant-leaf&source-code=${code}`)

const data = getApiResponseResources(response)
const codeList: string[] = []
Expand Down
4 changes: 2 additions & 2 deletions src/services/aphp/cohortCreation/fetchObservation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const fetchBiologyData = async (searchValue?: string, noStar?: boolean) =
: ''

const res = await apiFhir.get<any>(
`/ValueSet?url=${BIOLOGY_HIERARCHY_ITM_ANABIO},${BIOLOGY_HIERARCHY_ITM_LOINC}${_searchValue}&size=${
`/ValueSet?url=${BIOLOGY_HIERARCHY_ITM_ANABIO},${BIOLOGY_HIERARCHY_ITM_LOINC}${_searchValue}&_count=${
VALUE_SET_SIZE ?? 9999
}`
)
Expand All @@ -50,7 +50,7 @@ export const fetchBiologySearch = async (searchInput: string) => {
const lowerCaseTrimmedSearchInput = searchInput.toLowerCase().trim()

const res = await apiFhir.get<any>(
`/ConceptMap?size=2000&context=Maps%20to,Hierarchy%20Concat%20Parents&source-uri=${BIOLOGY_HIERARCHY_ITM_ANABIO}&target-uri=${BIOLOGY_HIERARCHY_ITM_ANABIO},${BIOLOGY_HIERARCHY_ITM_LOINC}&_text=${encodeURIComponent(
`/ConceptMap?_count=2000&context=Maps%20to,Hierarchy%20Concat%20Parents&source-uri=${BIOLOGY_HIERARCHY_ITM_ANABIO}&target-uri=${BIOLOGY_HIERARCHY_ITM_ANABIO},${BIOLOGY_HIERARCHY_ITM_LOINC}&_text=${encodeURIComponent(
lowerCaseTrimmedSearchInput.replace(/[\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') // eslint-disable-line
)},${encodeURIComponent(
`/(.)*${lowerCaseTrimmedSearchInput.replace(/[/"]/g, function (m) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/aphp/cohortCreation/fetchProcedure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const fetchCcamData = async (searchValue?: string, noStar?: boolean) => {
: ''

const res = await apiFhir.get<any>(
`/ValueSet?url=${PROCEDURE_HIERARCHY}${_searchValue}&size=${VALUE_SET_SIZE ?? 9999}`
`/ValueSet?url=${PROCEDURE_HIERARCHY}${_searchValue}&_count=${VALUE_SET_SIZE ?? 9999}`
)

const data =
Expand Down

0 comments on commit 247c9cf

Please sign in to comment.