diff --git a/mapping-tools/README.md b/mapping-tools/README.md index c943f50..2dec5fc 100644 --- a/mapping-tools/README.md +++ b/mapping-tools/README.md @@ -54,6 +54,7 @@ - [v1/inspire-category/meta-category/json](#v1/inspire-category/meta-category/json) - [v1/inspire-labos/in2p3-labos/json](#v1/inspire-labos/in2p3-labos/json) - [v1/rnsr/instituts-cnrs/json](#v1/rnsr/instituts-cnrs/json) +- [v1/hospital/affiliations](#v1/hospital/affiliations) ### v1/halAuthorId/idRef/json @@ -66,7 +67,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple de v1/halAuthorId/idRef/json @@ -98,7 +99,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple de v1/homogenize/documentType/json @@ -128,7 +129,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple de v1/homogenize/publisher/json @@ -156,7 +157,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple de v1/homogenize/source/json @@ -184,7 +185,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple v1/idRef/orcird/json @@ -215,7 +216,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple @@ -253,7 +254,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple @@ -288,7 +289,7 @@ | nom | description | | :----- | :--------------------------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | #### Exemple @@ -310,3 +311,34 @@ "value": "STIC" }] ``` + +### v1/hospital/affiliations + +Prend en entrée du JSON avec deux champs: `id` et `value`, où le champ +`value`est une adresse d'affiliation. Il renvoie un JSON avec l'hôpital +correspondant dans le champ `value`. + + **Remarque**: quand on ne trouve pas d'institut, la valeur est `n/a` (*not +> available*) + +#### Paramètres de v1/hospital/affiliations + +| nom | description | +| :----- | :--------------------------------------------------------------------- | +| indent | `true` ou `false`, indente le JSON résultat ou non (`false` par défaut) | + +#### Exemple + +Entrée + +```json +[ + {"id" :"1","value": "Hop La Pitie Salpetriere, AP HP, Serv Med Interne, Ctr Natl Reference Histiocytoses, Paris, France"}, + {"id" :"2","value": "UMR CNRS 7021, Illkirch Graffenstaden, France"}, + {"id" :"3","value": "Bergonie Inst, Dept Radiat Oncol, Bordeaux, France"}, + {"id" :"4","value": "CHU Besancon, Serv Neurol, 2 Blvd Fleming, F-25030 Besancon, France"}, + {"id" :"5","value": "CHU St Etienne, Ave Albert Raimond, F-42055 St Etienne, France"} +] +``` + +Sortie diff --git a/mapping-tools/examples.http b/mapping-tools/examples.http index a60a03f..065fac2 100644 --- a/mapping-tools/examples.http +++ b/mapping-tools/examples.http @@ -2,7 +2,8 @@ # l'extension REST Client (humao.rest-client) # To test locally, replace with -@baseUrl = http://localhost:31976 +#@baseUrl = http://localhost:31976 +@baseUrl = http://mapping-tools-5.tdmservices.intra.inist.fr #@baseUrl = https://mapping-tools.services.inist.fr # @name v1RnsrInstitutsCnrs diff --git a/mapping-tools/v1/hospital/affiliations.ini b/mapping-tools/v1/hospital/affiliations.ini index dcb7a33..c1619fe 100755 --- a/mapping-tools/v1/hospital/affiliations.ini +++ b/mapping-tools/v1/hospital/affiliations.ini @@ -1,25 +1,20 @@ # OpenAPI Documentation - JSON format (dot notation) mimeType = application/json -post.responses.default.description = Return all objects with enrich fields +post.responses.default.description = Trouve un hôpital associé à une adresse post.responses.default.content.application/json.schema.$ref = #/components/schemas/JSONStream -post.summary = Enrich one field of each Object with a Python function +post.summary = Trouve un hôpital dans une adresse d'affiliation +# Pour rétablir la colorisation: ' post.requestBody.required = true post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream post.parameters.0.in = query -post.parameters.0.name = path -post.parameters.0.schema.type = string -post.parameters.0.description = The path in each object to enrich with an Python script -post.parameters.1.in = query -post.parameters.1.name = indent -post.parameters.1.schema.type = boolean -post.parameters.1.description = Indent or not the JSON Result +post.parameters.0.name = indent +post.parameters.0.schema.type = boolean +post.parameters.0.description = Indent or not the JSON Result [use] plugin = @ezs/spawn plugin = @ezs/basics -plugin = @ezs/storage -plugin = @ezs/analytics [JSONParse] separator = * @@ -32,7 +27,7 @@ [expand/exec] # command should be executable ! -command = ./aff_hosp.py +command = ./affiliations.py [dump] indent = env('indent', false)