Skip to content
Snippets Groups Projects
Commit a833eca0 authored by Krop's avatar Krop
Browse files

started with nuance commands

parent d9e6ff2d
No related branches found
No related tags found
1 merge request!7Update study environments
......@@ -42,7 +42,7 @@
function NUSA_configure()
{
NUSA_userId = new URLSearchParams(window.location.search).get('userid');
NUSA_applicationName = 'ukw.modile';
NUSA_applicationName = 'ukw.mobile';
NUSA_service = 'https://nuance.ukw.de';
NUSA_language = 'de-DE';
NUSA_topic = window.parent.NUSA_topicGeneralMedicine;
......@@ -50,6 +50,7 @@
document.cookie = 'NUSA_Guids=479a9915-cbde-4093-9031-8c5868bef14c/911ceb62-7ffe-42b7-8a6d-37b24abad447';
NUSA_embedSpeechBar(document.getElementById("speechBarContainer"));
initNUSA();
}
function loadNUSA() {
......@@ -75,6 +76,7 @@
NUSA_embedSpeechBar(null);
NUSA_reinitializeVuiForm();
NUSA_embedSpeechBar(document.getElementById("speechBarContainer2"));
initNUSA();
}
}
url = window.location.href;
......@@ -83,6 +85,92 @@
}
};
function initNUSA() {
var cmdSetId = NUSA_createCommandSet("Anordnung ZLM AnA", "Verfügbare Sprachkommandos");
// Placeholder
NUSA_createCommandPlaceholder("datum", "Zeitangabe");
NUSA_createCommandPlaceholder("yesNoOption", "<ja/nein/unklar>");
// Schwangerschaft
NUSA_createCommand(cmdSetId, "pregnancy", "<standard:ordinal1-42> Schwangerschaftswoche", "<1.-42.> Schwangerschaftswoche");
NUSA_createCommand(cmdSetId, "pregnancy", "im <standard:ordinal1-9> Monat schwanger", "im <1.-9.> Monat schwanger");
NUSA_createCommand(cmdSetId, "pregnancy", "nicht schwanger", "nicht schwanger");
NUSA_createCommand(cmdSetId, "pregnancy", "schwanger <yesNoOption>", "schwanger <ja/nein/unklar>");
NUSA_createCommand(cmdSetId, "pregnancy", "schwanger im <standard:ordinal1-9> Monat", "schwanger im <1.-9> Monat");
NUSA_createCommand(cmdSetId, "pregnancy", "Schwangerschaftswoche <standard:cardinal1-42>", "Schwangerschaftswoche <1.-42>");
// Allergie
NUSA_createCommand(cmdSetId, "allergie", "Allergie vorhanden", "Allergie vorhanden");
NUSA_createCommand(cmdSetId, "allergie", "Allergie <yesNoOption>", "Allergie <ja/nein/unklar>");
NUSA_createCommand(cmdSetId, "allergie", "keine Allergien ", "keine Allergien ");
NUSA_createCommand(cmdSetId, "allergie", "Kontrastmittelallergie vorhanden", "Kontrastmittelallergie vorhanden");
NUSA_createCommand(cmdSetId, "allergie", "Kontrastmittelallergie <yesNoOption>", "Kontrastmittelallergie <ja/nein/unklar>");
NUSA_createCommand(cmdSetId, "allergie", "keine Kontrastmittelallergie", "keine Kontrastmittelallergie");
// Implantate
NUSA_createCommand(cmdSetId, "implants", "Implantate <yesNoOption>", "Implantate <ja/nein/unklar>");
NUSA_createCommand(cmdSetId, "implants", "Implantate vorhanden", "Implantate vorhanden");
NUSA_createCommand(cmdSetId, "implants", "keine Implantate", "keine Implantate");
NUSA_createCommand(cmdSetId, "implants", "keine Metallimplantate", "keine Metallimplantate");
// Schrittmacher
NUSA_createCommand(cmdSetId, "pacemaker", "kein Schrittmacher", "kein Schrittmacher");
NUSA_createCommand(cmdSetId, "pacemaker", "Schrittmacher <yesNoOption>", "Schrittmacher <ja/nein/unklar>");
NUSA_createCommand(cmdSetId, "pacemaker", "Schrittmacher vorhanden", "Schrittmacher vorhanden");
// Verbesserung schlecht Erkannter Worte
NUSA_createCommand(cmdSetId, "newLine", "9 Zeile", "Neue Zeile");
NUSA_createCommand(cmdSetId, "question", "Frage Zeichen", "Fragezeichen");
// Termin
NUSA_createCommand(cmdSetId, "termin", "Termin und", "Termin und -> Terminwunsch");
NUSA_createCommand(cmdSetId, "termin", "Termin Wunsch", "Termin Wunsch -> Terminwunsch");
NUSA_createCommand(cmdSetId, "terminDate", "Termin und <standard:date>", "Terminwunsch");
NUSA_createCommand(cmdSetId, "terminDate", "Termin Wunsch <standard:date>", "Terminwunsch");
}
function NUSA_onCommandRecognized(cmdId, spokenText, content, placeholderIds, placeholderValues) {
console.log("Command recognized: "+cmdId);
console.log("Placeholder IDs: "+placeholderIds);
console.log("Placeholder Values: "+placeholderValues);
switch(cmdId) {
case "newLine":
document.activeElement.value += "\n";
break;
case "question":
document.activeElement.value += "?";
break;
case "termin":
document.activeElement.value += "Terminwunsch";
break;
case "terminDate":
document.activeElement.value += "Terminwunsch ";
if (placeholderIds[0] == "standard_date") {
document.activeElement.value += " "+placeholderValues[0];
}
break;
case "pregnancy":
break;
case "allergie":
break;
case "implants":
break;
case "pacemaker":
break;
default: break;
}
}
function isIonicDone() {
return document.getElementById("speechBarContainer") != null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment