@tekkare/romulus 0.1.274 → 0.1.275
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/layer/nuxt.config.ts +3 -1
- package/layer/server/api/oip/es.post.ts +11 -3
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/layer/nuxt.config.ts
CHANGED
|
@@ -86,7 +86,9 @@ export default defineNuxtConfig({
|
|
|
86
86
|
hcp: { domain: "", auth: "" },
|
|
87
87
|
// Associations et registres d'autorisation etrangers : une autre cle sur
|
|
88
88
|
// le meme domaine, comme dans fr_drugs_app. Vides : la cle principale.
|
|
89
|
-
|
|
89
|
+
// Index de Germany One (G-BA, GKV) : la cle de Germany One. Vide : la
|
|
90
|
+
// cle principale.
|
|
91
|
+
drugs: { domain: "", auth: "", authAssociations: "", authApprovals: "", authGermany: "" },
|
|
90
92
|
},
|
|
91
93
|
},
|
|
92
94
|
});
|
|
@@ -4,6 +4,7 @@ import { findOipEsIndex, resolveOipEsIndex } from "../../utils/oipEsIndices";
|
|
|
4
4
|
import { oipResourceIndexes, type OipEsCluster } from "../../../app/utils/oipResources";
|
|
5
5
|
import { ES_INDEX } from "../../../app/oip-drugs/esIndices";
|
|
6
6
|
import { OIP_PATIENT_INDEXES } from "../../../app/oip-patients/indexes";
|
|
7
|
+
import { GERMANY_INDEX } from "../../../app/oip-germany/kinds";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* POST /api/oip/es?cluster=&index=, servi par le layer OIP.
|
|
@@ -18,14 +19,20 @@ import { OIP_PATIENT_INDEXES } from "../../../app/oip-patients/indexes";
|
|
|
18
19
|
* Cluster `drugs` : les index se designent par id Directus (ou par nom), comme
|
|
19
20
|
* dans fr_drugs_app. Ses associations et ses registres d'autorisation
|
|
20
21
|
* etrangers demandent une autre cle sur le meme domaine (`authAssociations`,
|
|
21
|
-
* `authApprovals`) ; a defaut, la cle principale.
|
|
22
|
+
* `authApprovals`) ; a defaut, la cle principale. Les index de Germany One
|
|
23
|
+
* (evaluations G-BA, molecules GKV) sont sur le meme domaine, hors du
|
|
24
|
+
* catalogue de fr_drugs_app : ils se designent par leur nom et se lisent avec
|
|
25
|
+
* `authGermany` (la cle de Germany One), a defaut la cle principale.
|
|
22
26
|
*
|
|
23
27
|
* Cluster `science` : les cas apres vaccination d'OIP Case Atlas ne se lisent
|
|
24
28
|
* pas avec la cle PubMed, mais avec une autre sur le meme domaine
|
|
25
29
|
* (`authVaccines`) ; a defaut, la cle principale.
|
|
26
30
|
*/
|
|
27
31
|
|
|
28
|
-
type KeyGroup = "auth" | "authAssociations" | "authApprovals" | "authVaccines";
|
|
32
|
+
type KeyGroup = "auth" | "authAssociations" | "authApprovals" | "authVaccines" | "authGermany";
|
|
33
|
+
|
|
34
|
+
/** Index de Germany One : par leur nom, hors du catalogue de fr_drugs_app. */
|
|
35
|
+
const GERMANY_INDEXES = new Set<string>(Object.values(GERMANY_INDEX));
|
|
29
36
|
|
|
30
37
|
const DRUG_IDS = new Set<string>(Object.values(ES_INDEX) as string[]);
|
|
31
38
|
const ASSOCIATION_IDS = new Set<string>(
|
|
@@ -45,12 +52,13 @@ const APPROVAL_IDS = new Set<string>(
|
|
|
45
52
|
* Vide si l'index n'est pas au catalogue.
|
|
46
53
|
*/
|
|
47
54
|
async function drugsKeyOf(ref: string): Promise<string> {
|
|
48
|
-
if (DRUG_IDS.has(ref)) return ref;
|
|
55
|
+
if (DRUG_IDS.has(ref) || GERMANY_INDEXES.has(ref)) return ref;
|
|
49
56
|
const id = (await findOipEsIndex(ref).catch(() => undefined))?.id;
|
|
50
57
|
return id && DRUG_IDS.has(id) ? id : "";
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
function drugsKeyGroup(id: string): KeyGroup {
|
|
61
|
+
if (GERMANY_INDEXES.has(id)) return "authGermany";
|
|
54
62
|
if (ASSOCIATION_IDS.has(id)) return "authAssociations";
|
|
55
63
|
if (APPROVAL_IDS.has(id)) return "authApprovals";
|
|
56
64
|
return "auth";
|