Esempio 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);
        }
Esempio 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));
        }
Esempio 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);
		}
Esempio 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);
        }
Esempio 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;
        }
Esempio n. 6
0
		public ModalityProcedureStepSummary CreateProcedureStepSummary(ModalityProcedureStep mps, IPersistenceContext context)
		{
			var psSummary = new ProcedureStepAssembler().CreateProcedureStepSummary(mps, context);
			return new ModalityProcedureStepSummary(psSummary, mps.Description);
		}