curl --request POST \
--url https://core.locusmedical.fr/v2/logic/compute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mku_key": "<string>",
"answers": {},
"checked": [
"<string>"
],
"level": "<string>",
"sources": [
"<string>"
],
"exclude_sources": [
"<string>"
]
}
'import requests
url = "https://core.locusmedical.fr/v2/logic/compute"
payload = {
"mku_key": "<string>",
"answers": {},
"checked": ["<string>"],
"level": "<string>",
"sources": ["<string>"],
"exclude_sources": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mku_key: '<string>',
answers: {},
checked: ['<string>'],
level: '<string>',
sources: ['<string>'],
exclude_sources: ['<string>']
})
};
fetch('https://core.locusmedical.fr/v2/logic/compute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.locusmedical.fr/v2/logic/compute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mku_key' => '<string>',
'answers' => [
],
'checked' => [
'<string>'
],
'level' => '<string>',
'sources' => [
'<string>'
],
'exclude_sources' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.locusmedical.fr/v2/logic/compute"
payload := strings.NewReader("{\n \"mku_key\": \"<string>\",\n \"answers\": {},\n \"checked\": [\n \"<string>\"\n ],\n \"level\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"exclude_sources\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://core.locusmedical.fr/v2/logic/compute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mku_key\": \"<string>\",\n \"answers\": {},\n \"checked\": [\n \"<string>\"\n ],\n \"level\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"exclude_sources\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.locusmedical.fr/v2/logic/compute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mku_key\": \"<string>\",\n \"answers\": {},\n \"checked\": [\n \"<string>\"\n ],\n \"level\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"exclude_sources\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"mku_id": "<string>",
"type": "<string>",
"computed": {
"total": 123,
"outcome": "<string>",
"outcome_id": "<string>",
"description": "<string>",
"path": [
"<string>"
],
"path_ids": [
"<string>"
],
"retained": [
{}
],
"reason": "<string>"
},
"mku_key": "",
"titre": "",
"url": "<string>",
"d_apres": "<string>",
"note": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Exécuter une unité logique désignée, sans retrieving
Applique le moteur déterministe (somme, comparaison, parcours de graphe) à une unité logique qu’on DÉSIGNE par sa clé, au lieu de la chercher.
À utiliser pour tous les tours intermédiaires d’un formulaire ouvert : cocher une case, choisir une branche, changer un niveau. /v2/retrieve reste la route quand la QUESTION change.
Deux propriétés que le second tour de /v2/retrieve ne peut pas offrir :
- déterminisme — l’unité est désignée, pas classée : impossible de recevoir l’interprétation d’un autre score que celui qu’on remplit ;
- coût — une lecture de nœud, aucun appel de modèle.
computed est le même objet que elicitations[].computed, produit par le même code. Un outcome: null avec un reason rempli est une réponse, pas une panne : « la source ne donne aucune interprétation pour ce total » est une information clinique.
404 quand aucune unité logique ne porte cette clé dans le périmètre de sources demandé. 400 sur une source inconnue.
curl --request POST \
--url https://core.locusmedical.fr/v2/logic/compute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mku_key": "<string>",
"answers": {},
"checked": [
"<string>"
],
"level": "<string>",
"sources": [
"<string>"
],
"exclude_sources": [
"<string>"
]
}
'import requests
url = "https://core.locusmedical.fr/v2/logic/compute"
payload = {
"mku_key": "<string>",
"answers": {},
"checked": ["<string>"],
"level": "<string>",
"sources": ["<string>"],
"exclude_sources": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mku_key: '<string>',
answers: {},
checked: ['<string>'],
level: '<string>',
sources: ['<string>'],
exclude_sources: ['<string>']
})
};
fetch('https://core.locusmedical.fr/v2/logic/compute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.locusmedical.fr/v2/logic/compute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mku_key' => '<string>',
'answers' => [
],
'checked' => [
'<string>'
],
'level' => '<string>',
'sources' => [
'<string>'
],
'exclude_sources' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.locusmedical.fr/v2/logic/compute"
payload := strings.NewReader("{\n \"mku_key\": \"<string>\",\n \"answers\": {},\n \"checked\": [\n \"<string>\"\n ],\n \"level\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"exclude_sources\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://core.locusmedical.fr/v2/logic/compute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mku_key\": \"<string>\",\n \"answers\": {},\n \"checked\": [\n \"<string>\"\n ],\n \"level\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"exclude_sources\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.locusmedical.fr/v2/logic/compute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mku_key\": \"<string>\",\n \"answers\": {},\n \"checked\": [\n \"<string>\"\n ],\n \"level\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"exclude_sources\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"mku_id": "<string>",
"type": "<string>",
"computed": {
"total": 123,
"outcome": "<string>",
"outcome_id": "<string>",
"description": "<string>",
"path": [
"<string>"
],
"path_ids": [
"<string>"
],
"retained": [
{}
],
"reason": "<string>"
},
"mku_key": "",
"titre": "",
"url": "<string>",
"d_apres": "<string>",
"note": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Locus API key — paste the raw lsk_… value (no 'Bearer ' prefix).
Body
L'unité à exécuter, par sa clé LISIBLE (« score:cha2ds2vasc ») ou par son mku_id. Les deux sont acceptés parce que les deux sont dans la payload de /v2/retrieve ; la clé survit à une ré-extraction, ce qui compte quand un formulaire reste ouvert.
Score : {intitulé de question: libellé de modalité}. Arbre : {id du nœud de décision: condition choisie}.
Exactement la forme de logic_answers[].answers — un client qui tient déjà un formulaire ouvert n'a rien à retraduire.
Show child attributes
Show child attributes
Score à cases : les libellés retenus.
Échelle ordinale : le niveau choisi (« NYHA II »).
Restriction d'éditeurs, comme sur /v2/retrieve. Vide = tous.
Éditeurs exclus, comme sur /v2/retrieve.
Response
Successful Response
L'unité identifiée et ce que le moteur en a fait. Rien d'autre.
Pas de trace_id : rien n'est tracé, parce qu'il n'y a pas de réponse
rédigée sur laquelle un utilisateur pourrait se prononcer.
score | tree
Le résultat du moteur — le MÊME objet que elicitations[].computed de /v2/retrieve, produit par le même code. outcome: null avec un reason rempli n'est pas une panne : « la source ne donne aucune interprétation pour ce total » est une information clinique.
Show child attributes
Show child attributes
Pourquoi cette unité n'est pas exécutable (formule non extraite, sous-scores…).