Пример #1
0
        private void TranslateActionSentence(TranslationContext context, Node node, CREFModel.MissingDataAssertion result)
        {
            // If we assert that the source artifact can only use specific types of expressions, and that the expressions must be literal (evaluable at compile-time)
            // then we can translate the basic aspects of the assertion, code, code system, and severity.
            var proposalExpression = node.Children.FirstOrDefault(c => c.Name == "actionSentence") as ASTNode;

            if (proposalExpression != null)
            {
                switch (proposalExpression.ResultType.Name)
                {
                case "SubstanceAdministrationProposal":
                case "SubstanceAdministrationEvent":
                {
                    var substanceCode = ((Node)proposalExpression).Children.FirstOrDefault(c => c.Name == "property" && c.Attributes.ContainsKey("name") && c.GetAttribute <string>("name") == "substance.substanceCode");
                    if (substanceCode != null)
                    {
                        var codeValue = substanceCode.Children.FirstOrDefault(c => c.Name == "value" && c.NodeType.GetLocalName() == "CodeLiteral");
                        if (codeValue != null)
                        {
                            result.Code    = codeValue.GetAttribute <string>("code");
                            result.CodeSet = codeValue.GetAttribute <string>("codeSystem");
                        }
                    }
                }
                break;
                }
            }
        }
Пример #2
0
        private CREFModel.ClinicalAssertion TranslateUpdateAction(TranslationContext context, Node node)
        {
            var result = new CREFModel.MissingDataAssertion();

            TranslateBaseClinicalAssertion(context, node, result);

            // TODO: Translate the action sentence
            // See the related comment in TranslateCreateAction

            TranslateActionSentence(context, node, result);

            return(result);
        }
Пример #3
0
        private CREFModel.ClinicalAssertion TranslateCreateAction(TranslationContext context, Node node)
        {
            var result = new CREFModel.MissingDataAssertion();

            TranslateBaseClinicalAssertion(context, node, result);

            // TODO: Translate the action sentence
            // In general, this will be extremely difficult because it involves figuring out what object type and code
            // is created as part of the resulting guidance, and then using that to set the code on the recommendation.
            // However, it is possible in HeD to actually set the code based on data provided as part of the evaluation.
            // In this case, it is not possible to determine the code to be returned. Manual translation would have to
            // be performed in that case.

            // Another option for translation is to evaluate the action and then just read the code from the appropriate
            // property on the resulting object.

            TranslateActionSentence(context, node, result);

            return(result);
        }
Пример #4
0
        private CREFModel.ClinicalAssertion TranslateCollectInformationAction(TranslationContext context, Node node)
        {
            var result = new CREFModel.MissingDataAssertion();

            TranslateBaseClinicalAssertion(context, node, result);

            var documentationConcept = node.Children.FirstOrDefault(c => c.Name == "documentationConcept");

            if (documentationConcept != null)
            {
                var itemCodes = documentationConcept.Children.FirstOrDefault(c => c.Name == "itemCodes");
                if (itemCodes != null)
                {
                    var itemCode = itemCodes.Children.FirstOrDefault(c => c.Name == "itemCode");
                    if (itemCode != null)
                    {
                        result.Code    = itemCode.GetAttribute <string>("code");
                        result.CodeSet = itemCode.GetAttribute <string>("codeSystemName");
                    }
                }
            }

            return(result);
        }
		private CREFModel.ClinicalAssertion TranslateUpdateAction(TranslationContext context, Node node)
		{
			var result = new CREFModel.MissingDataAssertion();
			TranslateBaseClinicalAssertion(context, node, result);

			// TODO: Translate the action sentence
				// See the related comment in TranslateCreateAction

			TranslateActionSentence(context, node, result);

			return result;
		}
		private CREFModel.ClinicalAssertion TranslateCreateAction(TranslationContext context, Node node)
		{
			var result = new CREFModel.MissingDataAssertion();
			TranslateBaseClinicalAssertion(context, node, result);

			// TODO: Translate the action sentence
				// In general, this will be extremely difficult because it involves figuring out what object type and code
				// is created as part of the resulting guidance, and then using that to set the code on the recommendation.
				// However, it is possible in HeD to actually set the code based on data provided as part of the evaluation.
				// In this case, it is not possible to determine the code to be returned. Manual translation would have to
				// be performed in that case.

				// Another option for translation is to evaluate the action and then just read the code from the appropriate 
				// property on the resulting object.

			TranslateActionSentence(context, node, result);

			return result;
		}
		private CREFModel.ClinicalAssertion TranslateCollectInformationAction(TranslationContext context, Node node)
		{
			var result = new CREFModel.MissingDataAssertion();
			TranslateBaseClinicalAssertion(context, node, result);

			var documentationConcept = node.Children.FirstOrDefault(c => c.Name == "documentationConcept");
			if (documentationConcept != null)
			{
				var itemCodes = documentationConcept.Children.FirstOrDefault(c => c.Name == "itemCodes");
				if (itemCodes != null)
				{
					var itemCode = itemCodes.Children.FirstOrDefault(c => c.Name == "itemCode");
					if (itemCode != null)
					{
						result.Code = itemCode.GetAttribute<string>("code");
						result.CodeSet = itemCode.GetAttribute<string>("codeSystemName");
					}
				}
			}

			return result;
		}