Ejemplo n.º 1
0
        public override void SaveInstance(ProcedureStep prototype, XmlElement xmlNode)
        {
            ModalityProcedureStep step = (ModalityProcedureStep)prototype;

            xmlNode.SetAttribute("description", step.Description);
            xmlNode.SetAttribute("modality", step.Modality.Id);
        }
Ejemplo n.º 2
0
        internal static TestResult ModalityAlignsWithPerformingFacility(ModalityProcedureStep mps)
        {
            // modality facility must match performing facility
            var valid = mps.Modality.Facility == null || mps.Modality.Facility.Equals(mps.Procedure.PerformingFacility);

            return(new TestResult(valid, SR.MessageValidateProcedurePerformingFacilityAndModalities));
        }
Ejemplo n.º 3
0
		internal static TestResult ModalityAlignsWithPerformingFacility(ModalityProcedureStep mps)
		{
			// modality facility must match performing facility
			var valid = mps.Modality.Facility == null || mps.Modality.Facility.Equals(mps.Procedure.PerformingFacility);

			return new TestResult(valid, SR.MessageValidateProcedurePerformingFacilityAndModalities);
		}
Ejemplo n.º 4
0
        public override ProcedureStep CreateInstance(XmlElement xmlNode, Procedure procedure)
        {
            ModalityProcedureStep step = new ModalityProcedureStep();

            // set description
            step.Description = GetAttribute(xmlNode, "description", true);

            // set modality - need to look up by ID
            try
            {
                string modalityId = GetAttribute(xmlNode, "modality", true);
                ModalitySearchCriteria where = new ModalitySearchCriteria();
                where.Id.EqualTo(modalityId);

                // TODO might as well cache this query
                step.Modality = PersistenceScope.CurrentContext.GetBroker <IModalityBroker>().FindOne(where);
            }
            catch (EntityNotFoundException e)
            {
                throw new ProcedureBuilderException("Modality ID {0} is not valid.", e);
            }

            return(step);
        }
Ejemplo n.º 5
0
        public override ProcedureStep CreateInstance(XmlElement xmlNode, Procedure procedure)
        {
            ModalityProcedureStep step = new ModalityProcedureStep();

            // set description
            step.Description = GetAttribute(xmlNode, "description", true);

            // set modality - need to look up by ID
            try
            {
                string modalityId = GetAttribute(xmlNode, "modality", true);
                ModalitySearchCriteria where = new ModalitySearchCriteria();
                where.Id.EqualTo(modalityId);

                // TODO might as well cache this query
                step.Modality = PersistenceScope.CurrentContext.GetBroker<IModalityBroker>().FindOne(where);
            }
            catch (EntityNotFoundException e)
            {
                throw new ProcedureBuilderException("Modality ID {0} is not valid.", e);
            }

            return step;
        }
Ejemplo n.º 6
0
		public ModalityProcedureStepSummary CreateProcedureStepSummary(ModalityProcedureStep mps, IPersistenceContext context)
		{
			var psSummary = new ProcedureStepAssembler().CreateProcedureStepSummary(mps, context);
			return new ModalityProcedureStepSummary(psSummary, mps.Description);
		}