QuestionAnswer类型的正确用法是什么? [英] What's the correct usage of QuestionAnswer types?

查看:129
本文介绍了QuestionAnswer类型的正确用法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在创建一个捕获自定义数据的应用程序。是否需要自定义数据类型我假设最好尽可能尝试使用现有的可编码值。以一个简单的问答情节为例。


问题:你今天感到多么焦虑?

可能的答案选择(使用答案选择量词汇量) ):





















AFairAmount 合理金额
ALittle 一点
ALot 很多
NoAtAll 完全没有

答案:相当数额


我按如下方式创建QuestionAnswer:


QuestionAnswer anxietyQuestionAnswer = new QuestionAnswer(new HealthServiceDateTime(DateTime.Now),new CodableValue("你今天感觉多么焦虑") ));


词汇answerVocabulary = ApplicationConnection.GetVocabulary(" answer-choices-amount");


foreach(KeyValuePair< string,VocabularyItem> answerVocabulary中的词汇项目)

{

    anxietyQuestionAnswer.AnswerChoice.Add(new CodableValue(vocabularyItem.Value.DisplayText,vocabularyItem.Value));

}
$


//选择第一个答案选择为了简单起见。
anxietyQuestionAnswer.Answer.Add(
anxietyQuestionAnswer.AnswerChoice .First());




PersonInfo.SelectedRecord.NewItem(anxietyQuestionAnswer);



我想到了几个问题:


  1. 用于问题文本的可编码值是否应该不仅仅是一个字符串?
  2. 答案选择的可编码值是否正确使用?
  3. 是否假设任何"有用的值"。 (在这种情况下数字)答案完全由申请处理?
  4. 如果问题3是,则可以假设应用程序存储的任何代码将保持一致,并且应用程序不需要保持任何潜在的更改(例如将'NoAtAll'更正为'NotAtAll')?

对前两个问题的略微一般性质表示道歉。我已经阅读了关于可编码值和词汇的文档,但感觉一个例子可能有助于澄清事情。


谢谢,


康拉德




解决方案

看起来您正在使用问题/答案类型。这是尝试回答您的具体问题。如果您需要更多信息,请与我们联系。


1。如果可能的话,通常最好对可编码值进行编码。我们没有为可编码值的所有可能使用定义词汇表,但这不应该阻止您提出自己的代码或使用其他行业标准(如果可用)。
如果您尝试对结果进行任何机械处理,那么对于进行字符串比较的代码进行编程要容易得多。我知道有这些问题/答案的私人词汇表,但我不知道任何公开的词汇。你可能想要
来提出你自己的词汇并用它来编码项目。


2。看起来您正确地使用可编码值作为答案,但是,将整个VocabularyItem作为第二个参数传递给CodableValue构造函数,而不仅仅是Value属性。这将确保CodableValue完全编码。


3。任何不属于HealthVault词汇表的答案都需要由使用CodableValue.Text属性的应用程序处理。


4。 HealthVault不会修改任何用户数据,我们需要在任何现有应用程序的数据模型中保持向后兼容性。因此,无论您如何设置Text属性或代码CodableValue,这些都将保持不变。对于我们维护的
词汇,我们将始终保持相同的代码值,但如果存在问题,可能会更新文本。例如,如果词汇表"wc"为(家庭),"答案选择金额" (词汇​​表),1(版本)具有代码"NoAtAll"。
显示文字"完全没有",我们可能会将显示文字更新为"完全没有"。但我们永远不会改变"NoAtAll"中的代码。到"NotAtAll"。如果问题是患者的安全性,安全性或隐私问题,我们b $ b可能会引入新版本的词汇表,但代码已经更改,但我们在过去的六年中没有看到这样做的必要性。 / p>


Hello,

I'm creating an application which will capture custom data. Whether custom data types are required or not I'm assuming it is best to try and use existing codable values where possible. Take for example a simple question and answer scenario.

Question: How anxious are you feeling today?
Possible Answer Choices (using the answer-choices-amount vocabulary):

AFairAmount A fair amount
ALittle A little
ALot A lot
NoAtAll Not at all

Answer: A fair amount

I create the QuestionAnswer as follows:

QuestionAnswer anxietyQuestionAnswer = new QuestionAnswer(new HealthServiceDateTime(DateTime.Now), new CodableValue("How anxious are you feeling today"));

Vocabulary answerVocabulary = ApplicationConnection.GetVocabulary("answer-choices-amount");

foreach (KeyValuePair<string, VocabularyItem> vocabularyItem in answerVocabulary)
{
    anxietyQuestionAnswer.AnswerChoice.Add(new CodableValue(vocabularyItem.Value.DisplayText, vocabularyItem.Value));
}

//select the first answer choice for the sake of simplicity
anxietyQuestionAnswer.Answer.Add(
anxietyQuestionAnswer.AnswerChoice.First());

PersonInfo.SelectedRecord.NewItem(anxietyQuestionAnswer);

A few questions spring to mind:

  1. Should the codable value used for the question text be more than just a string?
  2. Is the codable value for the answer choice being used correctly?
  3. Is it assumed that any "useful values" (numerical in this case) for answers are handled entirely by the application?
  4. If yes to question 3. then can it be assumed that any codes stored by the application will remain consistent and the application will not need to keep on top of any potential changes (an example might be the correction of 'NoAtAll' to 'NotAtAll')?

Apologies for the slightly general nature of the first two questions. I've read the docs on codable values and vocabularies but feel an example might help clarify things.

Thanks,

Conrad


解决方案

It looks like you are using the Question/Answer type correctly. Here is an attempt to answer your specific questions. Let me know if you need more.

1. It's usually best to code the codable values if at all possible. We don't define vocabularies for all possible usage of codable values, but that shouldn't stop you from coming up with your own codes or using other industry standards if they are available. It's much easier to program against codes that do string comparisons if you try to do any mechanical processing of the results. I do know there are private vocabularies for these sorts of questions/answers but I'm not aware of any public ones. You might want to come up with your own vocabulary and code the items with that.

2. It does appear that you are using the codable value correctly for the answer, however, pass the entire VocabularyItem as the second parameter to the CodableValue constructor, not just the Value property. This will ensure the CodableValue is coded completely.

3. Any answers that aren't part of a HealthVault vocabulary will need to be handled by the application using the CodableValue.Text property.

4. HealthVault does not modify any user data and we are required to maintain backward compatibility within the data model for any existing apps. So, regardless of how you set the Text property or code the CodableValue, those will remain untouched. For the vocabs that we maintain, we will always keep the same code values but may update the text if there are issues. For example, if the vocabulary "wc" (family), "answer-choices-amount" (vocabulary), 1 (version) had a code "NoAtAll" that had display text "No at all", we might update the display text to be "Not at all" but we'd never change the code from "NoAtAll" to "NotAtAll". If the issue was a matter of patient safety, security, or privacy, we might introduce a new version of the vocabulary with the code changed but we haven't seen a need to do that in the past six years.


这篇关于QuestionAnswer类型的正确用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆