示例#1
0
		public AttachmentSummary(EnumValueInfo category, StaffSummary attachedBy, DateTime attachedTime, AttachedDocumentSummary document)
		{
			this.Category = category;
			this.AttachedBy = attachedBy;
			this.AttachedTime = attachedTime;
			this.Document = document;
		}
		public RegistrationWorklistItemSummary(
			EntityRef procedureRef,
			EntityRef orderRef,
			EntityRef patientRef,
			EntityRef profileRef,
			CompositeIdentifierDetail mrn,
			PersonNameDetail name,
			string accessionNumber,
			EnumValueInfo orderPriority,
			EnumValueInfo patientClass,
			string diagnosticServiceName,
			string procedureName,
			bool procedurePortable,
			EnumValueInfo procedureLaterality,
			DateTime? time)
			:base(
				null,
				procedureRef,
				orderRef,
				patientRef,
				profileRef,
				mrn,
				name,
				accessionNumber,
				orderPriority,
				patientClass,
				diagnosticServiceName,
				procedureName,
				procedurePortable,
				procedureLaterality,
				null,
				time
			)
		{
		}
示例#3
0
		public UserDetail(
			EnumValueInfo accountType,
			string userId,
			string displayName,
			string emailAddress,
			DateTime creationTime,
			DateTime? validFrom,
			DateTime? validUntil,
			DateTime? lastLoginTime,
			bool enabled,
			DateTime? expiryTime,
			List<AuthorityGroupSummary> authorityGroups)
		{
			AccountType = accountType;
			UserName = userId;
			DisplayName = displayName;
			AuthorityGroups = authorityGroups;
			CreationTime = creationTime;
			ValidFrom = validFrom;
			ValidUntil = validUntil;
			LastLoginTime = lastLoginTime;
			Enabled = enabled;
			PasswordExpiryTime = expiryTime;
			EmailAddress = emailAddress;
		}
 public void UpdatePhoneNumber(EnumValueInfo simplePhoneType, TelephoneNumber number)
 {
     SimplifiedPhoneType type = (SimplifiedPhoneType)Enum.Parse(typeof(SimplifiedPhoneType), simplePhoneType.Code);
     switch (type)
     {
         case SimplifiedPhoneType.Home:
             number.Equipment = TelephoneEquipment.PH;
             number.Use = TelephoneUse.PRN;
             break;
         case SimplifiedPhoneType.Work:
             number.Equipment = TelephoneEquipment.PH;
             number.Use = TelephoneUse.WPN;
             break;
         case SimplifiedPhoneType.Mobile:
             number.Equipment = TelephoneEquipment.CP;
             number.Use = TelephoneUse.PRN;
             break;
         case SimplifiedPhoneType.Fax:
             number.Equipment = TelephoneEquipment.FX;
             number.Use = TelephoneUse.WPN;
             break;
         case SimplifiedPhoneType.Pager:
             number.Equipment = TelephoneEquipment.BP;
             number.Use = TelephoneUse.WPN;
             break;
         case SimplifiedPhoneType.Unknown:
             // do nothing
             break;
     }
 }
示例#5
0
 public HealthcardDetail(string id, EnumValueInfo assigningAuthority, string versionCode, DateTime? expiryDate)
 {
     this.Id = id;
     this.AssigningAuthority = assigningAuthority;
     this.VersionCode = versionCode;
     this.ExpiryDate = expiryDate;
 }
示例#6
0
        public ProcedureStepDetail(
            EntityRef procedureStepRef,
            string procedureStepName,
            string stepClassName,
			string description,
            EnumValueInfo state,
			DateTime? creationTime,
            DateTime? scheduledStartTime,
            DateTime? startTime,
            DateTime? endTime,
            StaffSummary scheduledPerformer,
            StaffSummary performer,
			ModalitySummary modality
            )
        {
            this.ProcedureStepRef = procedureStepRef;
            this.ProcedureStepName = procedureStepName;
            this.StepClassName = stepClassName;
        	this.Description = description;
            this.State = state;
        	this.CreationTime = creationTime;
            this.ScheduledStartTime = scheduledStartTime;
            this.StartTime = startTime;
            this.EndTime = endTime;
			this.Modality = modality;
			this.ScheduledPerformer = scheduledPerformer;
            this.Performer = performer;
        }
示例#7
0
		/// <summary>
		/// Constructor for returning only the most basic information about a user.
		/// </summary>
		public UserSummary(EnumValueInfo accountType, string userId, string displayName, string emailAddress)
		{
			AccountType = accountType;
			UserName = userId;
			DisplayName = displayName;
			EmailAddress = emailAddress;
		}
示例#8
0
		/// <summary>
		/// Constructor for returning full user summary.
		/// </summary>
		public UserSummary(
			EnumValueInfo accountType,
			string userId,
			string displayName,
			string emailAddress,
			DateTime creationTime,
			DateTime? validFrom,
			DateTime? validUntil,
			DateTime? lastLoginTime,
			DateTime? passwordExpiry,
			bool enabled,
			int sessionCount)
		{
			AccountType = accountType;
			UserName = userId;
			DisplayName = displayName;
			EmailAddress = emailAddress;
			CreationTime = creationTime;
			ValidFrom = validFrom;
			ValidUntil = validUntil;
			LastLoginTime = lastLoginTime;
			Enabled = enabled;
			PasswordExpiry = passwordExpiry;
			SessionCount = sessionCount;
		}
		/// <summary>
		/// Constructor for use by service to return requisition back to client for editing.
		/// </summary>
		public ProcedureRequisition(
			EntityRef procedureRef,
			ProcedureTypeSummary procedureType,
			string procedureNumber,
			DateTime? scheduledTime,
			int scheduledDuration,
			ModalitySummary modality,
			EnumValueInfo schedulingCode,
			FacilitySummary performingFacility,
			DepartmentSummary performingDepartment,
			EnumValueInfo laterality,
			bool portableModality,
			bool checkedIn,
			EnumValueInfo status,
			bool canModify,
			bool cancelled)
		{
			this.ProcedureRef = procedureRef;
			this.ProcedureType = procedureType;
			this.ProcedureNumber = procedureNumber;
			this.ScheduledTime = scheduledTime;
			this.ScheduledDuration = scheduledDuration;
			this.Modality = modality;
			this.SchedulingCode = schedulingCode;
			this.PerformingFacility = performingFacility;
			this.PerformingDepartment = performingDepartment;
			this.Laterality = laterality;
			this.PortableModality = portableModality;
			this.CheckedIn = checkedIn;
			this.Status = status;
			this.CanModify = canModify;
			this.Cancelled = cancelled;
		}
示例#10
0
 public ReportPartDetail(
     EntityRef reportPartRef,
     int index,
     bool isAddendum,
     EnumValueInfo status,
     DateTime creationTime,
     DateTime? preliminaryTime,
     DateTime? completedTime,
     DateTime? cancelledTime,
     StaffSummary supervisor,
     StaffSummary interpretedBy,
     StaffSummary transcribedBy,
     StaffSummary transcriptionSupervisor,
     StaffSummary verifiedBy,
     EnumValueInfo transcriptionRejectReason,
     Dictionary<string, string> extendedProperties)
 {
     this.ReportPartRef = reportPartRef;
     this.Index = index;
     this.IsAddendum = isAddendum;
     this.Status = status;
     this.CreationTime = creationTime;
     this.PreliminaryTime = preliminaryTime;
     this.CompletedTime = completedTime;
     this.CancelledTime = cancelledTime;
     this.Supervisor = supervisor;
     this.InterpretedBy = interpretedBy;
     this.TranscribedBy = transcribedBy;
     this.TranscriptionSupervisor = transcriptionSupervisor;
     this.VerifiedBy = verifiedBy;
     this.TranscriptionRejectReason = transcriptionRejectReason;
     this.ExtendedProperties = extendedProperties;
 }
 public PatientNoteCategoryDetail(EntityRef categoryRef, string category, string description, EnumValueInfo severity, bool deactivated)
 {
 	this.NoteCategoryRef = categoryRef;
     this.Category = category;
     this.Description = description;
     this.Severity = severity;
 	this.Deactivated = deactivated;
 }
示例#12
0
		public ProcedureSummary(EntityRef rpRef, EntityRef orderRef, ProcedureTypeSummary type, EnumValueInfo laterality, bool portable)
		{
			this.ProcedureRef = rpRef;
			this.OrderRef = orderRef;
			this.Type = type;
			this.Laterality = laterality;
			this.Portable = portable;
		}
示例#13
0
		public FacilityDetail(EntityRef facilityRef, string code, string name, string description, EnumValueInfo informationAuthority, bool deactivated)
		{
			this.FacilityRef = facilityRef;
			this.Code = code;
			this.Name = name;
			this.Description = description;
			this.InformationAuthority = informationAuthority;
			this.Deactivated = deactivated;
		}
 public ContactPersonDetail(EnumValueInfo type, string name, string address, string homePhoneNumber, string businessPhoneNumber, EnumValueInfo relationship)
 {
     this.Type = type;
     this.Name = name;
     this.Address = address;
     this.HomePhoneNumber = homePhoneNumber;
     this.BusinessPhoneNumber = businessPhoneNumber;
     this.Relationship = relationship;
 }
		public RejectProtocolRequest(
			EntityRef protocolAssignmentStepRef, 
			EntityRef supervisorRef, 
			EnumValueInfo rejectReason, 
			OrderNoteDetail additionalCommentsNote)
			: base(protocolAssignmentStepRef, supervisorRef)
		{
			this.RejectReason = rejectReason;
			this.AdditionalCommentsNote = additionalCommentsNote;
		}
示例#16
0
		public ModalityDetail(EntityRef modalityRef, string id, string name, FacilitySummary facility, string aeTitle, EnumValueInfo dicomModality, bool deactivated)
		{
			this.ModalityRef = modalityRef;
			this.Id = id;
			this.Name = name;
			this.Facility = facility;
			this.AETitle = aeTitle;
			this.DicomModality = dicomModality;
			this.Deactivated = deactivated;
		}
		public ModalityPerformedProcedureStepDetail(EntityRef modalityPerformendProcedureStepRef, EnumValueInfo state, DateTime startTime, DateTime? endTime, StaffSummary performer, List<ModalityProcedureStepSummary> modalityProcedureSteps, List<DicomSeriesDetail> dicomSeries, Dictionary<string, string> extendedProperties)
		{
			this.ModalityPerformendProcedureStepRef = modalityPerformendProcedureStepRef;
			this.State = state;
			this.StartTime = startTime;
			this.EndTime = endTime;
			this.Performer = performer;
			this.ModalityProcedureSteps = modalityProcedureSteps;
			this.DicomSeries = dicomSeries;
			this.ExtendedProperties = extendedProperties;
		}
		public RejectProtocolRequest(
			EntityRef protocolAssignmentStepRef,
			ProtocolDetail protocol,
			List<OrderNoteDetail> orderNotes,
			EnumValueInfo rejectReason,
			OrderNoteDetail additionalCommentsNote)
			: base(protocolAssignmentStepRef, protocol, orderNotes)
		{
			this.RejectReason = rejectReason;
			this.AdditionalCommentsNote = additionalCommentsNote;
		}
示例#19
0
		public ModalityProcedureStepSummary(
			EntityRef procedureStepRef,
			string procedureStepName,
			EnumValueInfo state,
			DateTime? startTime,
			DateTime? endTime,
			ModalitySummary modality,
			ProcedureSummary procedure,
			String description)
			: base(procedureStepRef, procedureStepName, state, startTime, endTime, modality, procedure)
		{
			this.Description = description;
		}
 public ReportingWorklistItemSummary(
     EntityRef procedureStepRef,
     EntityRef procedureRef,
     EntityRef orderRef,
     EntityRef patientRef,
     EntityRef profileRef,
     EntityRef reportRef,
     CompositeIdentifierDetail mrn,
     PersonNameDetail name,
     string accessionNumber,
     EnumValueInfo orderPriority,
     EnumValueInfo patientClass,
     string diagnosticServiceName,
     string procedureName,
     bool procedurePortable,
     bool hasErrors,
     EnumValueInfo procedureLaterality,
     string procedureStepName,
     DateTime? time,
     EnumValueInfo activityStatus,
     int reportPartIndex)
     : base(
         procedureStepRef,
         procedureRef,
         orderRef,
         patientRef,
         profileRef,
         mrn,
         name,
         accessionNumber,
         orderPriority,
         patientClass,
         diagnosticServiceName,
         procedureName,
         procedurePortable,
         procedureLaterality,
         procedureStepName,
         time
     )
 {
     this.ReportRef = reportRef;
     this.ActivityStatus = activityStatus;
     this.ReportPartIndex = reportPartIndex;
     this.HasErrors = hasErrors;
 }
		public ProcedureStepSummary(
			EntityRef procedureStepRef,
			string procedureStepName,
			EnumValueInfo state,
			DateTime? startTime,
			DateTime? endTime,
			ModalitySummary modality,
			ProcedureSummary procedure
			)
		{
			this.ProcedureStepRef = procedureStepRef;
			this.ProcedureStepName = procedureStepName;
			this.State = state;
			this.StartTime = startTime;
			this.EndTime = endTime;
			this.Modality = modality;
			this.Procedure = procedure;
		}
示例#22
0
		public PatientAllergyDetail(EnumValueInfo allergenType,
			string allergenDescription,
			EnumValueInfo severity,
			string reaction,
			EnumValueInfo sensitivityType,
			DateTime? onsetTime,
			DateTime? reportedTime,
			PersonNameDetail reporterName,
			EnumValueInfo reporterRelationshipType)
		{
			this.AllergenType = allergenType;
			this.AllergenDescription = allergenDescription;
			this.Severity = severity;
			this.Reaction = reaction;
			this.SensitivityType = sensitivityType;
			this.OnsetTime = onsetTime;
			this.ReportedTime = reportedTime;
			this.ReporterName = reporterName;
			this.ReporterRelationshipType = reporterRelationshipType;
		}
示例#23
0
		public StaffDetail(EntityRef staffRef, string staffId, EnumValueInfo staffType,
			PersonNameDetail personNameDetail, EnumValueInfo sex,
			string title, string licenseNumber, string billingNumber,
			List<TelephoneDetail> telephoneNumbers, List<AddressDetail> addresses, List<EmailAddressDetail> emailAddresses,
			List<StaffGroupSummary> groups, Dictionary<string, string> extendedProperties, bool deactivated, string userName)
		{
			this.StaffRef = staffRef;
			this.StaffId = staffId;
			this.StaffType = staffType;
			this.Name = personNameDetail;
			this.Sex = sex;
			this.Title = title;
			this.LicenseNumber = licenseNumber;
			this.BillingNumber = billingNumber;
			this.TelephoneNumbers = telephoneNumbers;
			this.Addresses = addresses;
			this.EmailAddresses = emailAddresses;
			this.Groups = groups;
			this.ExtendedProperties = extendedProperties;
			this.Deactivated = deactivated;
			this.UserName = userName;
		}
示例#24
0
        public PriorProcedureSummary(
            EntityRef orderRef,
            EntityRef procedureRef,
            EntityRef reportRef,
            string accessionNumber,
            DiagnosticServiceSummary diagnosticService,
            ProcedureTypeSummary procedureType,
			bool procedurePortable,
			EnumValueInfo procedureLaterality,
            EnumValueInfo reportStatus,
            DateTime? performedDate)
        {
            this.OrderRef = orderRef;
            this.ProcedureRef = procedureRef;
            this.ReportRef = reportRef;
            this.AccessionNumber = accessionNumber;
            this.DiagnosticService = diagnosticService;
            this.ProcedureType = procedureType;
        	this.ProcedurePortable = procedurePortable;
        	this.ProcedureLaterality = procedureLaterality;
            this.ReportStatus = reportStatus;
            this.PerformedDate = performedDate;
        }
		public ExternalPractitionerContactPointDetail(
			EntityRef contactPointRef, string name, string description, bool isDefaultContactPoint,
			EnumValueInfo preferredResultCommunicationMode, EnumValueInfo informationAuthority,
			List<TelephoneDetail> phoneDetails, List<AddressDetail> addressDetails, List<EmailAddressDetail> emailAddressDetails,
			TelephoneDetail currentPhone, TelephoneDetail currentFax, AddressDetail currentAddress, EmailAddressDetail currentEmailAddress,
			ExternalPractitionerContactPointSummary mergeDestination, bool isMerged, bool deactivated)
		{
			this.ContactPointRef = contactPointRef;
			this.Name = name;
			this.Description = description;
			this.IsDefaultContactPoint = isDefaultContactPoint;
			this.PreferredResultCommunicationMode = preferredResultCommunicationMode;
			this.InformationAuthority = informationAuthority;
			this.TelephoneNumbers = phoneDetails;
			this.Addresses = addressDetails;
			this.EmailAddresses = emailAddressDetails;
			this.CurrentPhoneNumber = currentPhone;
			this.CurrentFaxNumber = currentFax;
			this.CurrentAddress = currentAddress;
			this.CurrentEmailAddress = currentEmailAddress;
			this.MergeDestination = mergeDestination;
			this.IsMerged = isMerged;
			this.Deactivated = deactivated;
		}
示例#26
0
        /// <summary>
        /// Creates a new visit for the specified patient.
        /// </summary>
        /// <param name="patientRef">Patient for which the visit is created.</param>
        /// <param name="informationAuthority">Information authority to use for the visit number.</param>
        /// <param name="admitOffsetDays">A positive or negative number of days from today.</param>
        /// <param name="AdmissionType">Emergency or other types</param>
        /// <returns></returns>
        public static VisitSummary CreateVisit(PatientProfileSummary patientProfile, EnumValueInfo informationAuthority, int admitOffsetDays, EnumValueInfo AdmissionType)
        {
            InitReferenceDataCacheOnce();

            // Generate an active visit with randomize properties

            var          now = Platform.Time;
            const string activeAdmittedVisitStatus = "AA";
            var          visitDetail = new VisitDetail
            {
                Patient       = patientProfile,
                VisitNumber   = new CompositeIdentifierDetail(GenerateRandomIntegerString(10), informationAuthority),
                PatientClass  = ChooseRandom(_visitEditorFormData.PatientClassChoices),
                PatientType   = ChooseRandom(_visitEditorFormData.PatientTypeChoices),
                AdmissionType = AdmissionType ?? ChooseRandom(_visitEditorFormData.AdmissionTypeChoices),
                Status        = CollectionUtils.SelectFirst(_visitEditorFormData.VisitStatusChoices, enumValue => enumValue.Code == activeAdmittedVisitStatus),
                AdmitTime     = now + TimeSpan.FromDays(admitOffsetDays),
                Facility      = ChooseRandom(_visitEditorFormData.FacilityChoices)
            };

            VisitSummary visit = null;

            Platform.GetService(
                delegate(IVisitAdminService service)
            {
                var addVisitResponse = service.AddVisit(new AddVisitRequest(visitDetail));
                visit = addVisitResponse.Visit;
            });

            return(visit);
        }
示例#27
0
        private static string GetLocalizedNameFromValueInternal(EnumValueInfo valueInfo, CultureInfo culture)
        {
            TEnum  value         = valueInfo.Value;
            string invariantName = valueInfo.InvariantName;
            Dictionary <string, LocalizedNameDictionary> localizedNamesByCultureName = LocalizedNamesByCultureName;

            CultureInfo originalCulture = CultureInfo.CurrentCulture;

            // Yes, we want reference equality here, not value equality. We only want to do this if we were passed
            // the actual CurrentCulture object, not just a culture that happens to be equal to it.
            if (culture == originalCulture)
            {
                // Normally, TypeConverters do actual conversion, not resource lookups, so they are usually passed
                // CurrentCulture, rather than CurrentUICulture (which will often be a neutral culture that throws
                // if used for anything other than resource lookup). Since we ARE actually doing resource lookups,
                // it is reasonable to try the CurrentUICulture first instead of the CurrentCulture, if that is
                // indeed what was passed to us.
                culture = CultureInfo.CurrentUICulture;

                // However, if the CurrentCulture and the CurrentUICulture are equal, we can just null out
                // originalCulture so that we don't try to do lookups against that culture twice.
                if (culture.Equals(originalCulture))
                {
                    originalCulture = null;
                }
            }
            else
            {
                originalCulture = null;
            }

L_ProcessCulture:
            string cultureName = culture.Name;

            LocalizedNameDictionary localizedNameDictionary;
            bool   dictionaryAlreadyExists = localizedNamesByCultureName.TryGetValue(cultureName, out localizedNameDictionary);
            string localizedName;

            if (dictionaryAlreadyExists && localizedNameDictionary.TryGetName(value, out localizedName))
            {
                return(localizedName);
            }
            localizedName = ResourceAccessor <TResourceManagerSource> .ResourceManager.GetString(valueInfo.ResourceName, culture);

            bool localizedNameIsNullOrEmpty = string.IsNullOrEmpty(localizedName);

            if (localizedNameIsNullOrEmpty || localizedName == invariantName)
            {
                if (localizedNameIsNullOrEmpty && originalCulture != null)
                {
                    // We didn't find a resource (or we found an empty one, see next comment) for
                    // CurrentUICulture, so go back and try the culture that we were originally passed.
                    culture         = originalCulture;
                    originalCulture = null;
                    goto L_ProcessCulture;
                }

                // Don't bother saving the Invariant name in the LocalizedNamesDictionary,
                // since we always check the InvariantNameDictionary first.
                // Also, we don't allow empty strings as the name, so if that is what the
                // resource contained, we just ignore it.
                return(invariantName);
            }
            else
            {
                if (!dictionaryAlreadyExists)
                {
                    // Make sure we don't blow away any other dictionaries for this culture that have been
                    // created in the mean time.
                    lock (LockObject)
                    {
                        if (!localizedNamesByCultureName.TryGetValue(cultureName, out localizedNameDictionary))
                        {
                            localizedNamesByCultureName[cultureName] = localizedNameDictionary = new LocalizedNameDictionary();
                        }
                    }
                }
                localizedNameDictionary.Add(localizedName, value);
                return(localizedName);
            }
        }
示例#28
0
 public ReplaceOrderRequest(EntityRef orderRef, EnumValueInfo cancelReason, OrderRequisition newRequisition)
 {
     this.OrderRef = orderRef;
     this.CancelReason = cancelReason;
     this.Requisition = newRequisition;
 }
		private void ExecuteHelper(EntityRef procedureStepRef, EnumValueInfo reason, string otherReason, EntityRef supervisorRef)
		{
			Platform.GetService<IProtocollingWorkflowService>(
				delegate(IProtocollingWorkflowService service)
				{
					RejectProtocolRequest request = new RejectProtocolRequest(
						procedureStepRef, 
						supervisorRef,
						reason,
						CreateAdditionalCommentsNote(otherReason));
					service.RejectProtocol(request);
				});
		}
		public RejectTranscriptionRequest(EntityRef reportingStepRef, Dictionary<string, string> reportPartExtendedProperties, EnumValueInfo rejectReason, OrderNoteDetail additionalComments)
			: base(reportingStepRef, reportPartExtendedProperties)
		{
			this.RejectReason = rejectReason;
			this.AdditionalComments = additionalComments;
		}
 public CancelOrderRequest(EntityRef orderRef, EnumValueInfo cancelReason)
 {
     this.OrderRef     = orderRef;
     this.CancelReason = cancelReason;
 }
示例#32
0
 public ReplaceOrderRequest(EntityRef orderRef, EnumValueInfo cancelReason, OrderRequisition newRequisition)
 {
     this.OrderRef     = orderRef;
     this.CancelReason = cancelReason;
     this.Requisition  = newRequisition;
 }
		public RejectTranscriptionRequest(EntityRef reportingStepRef, EnumValueInfo rejectReason, OrderNoteDetail additionalComments)
			: this(reportingStepRef, null, rejectReason, additionalComments)
		{
		}
示例#34
0
 /// <summary>
 /// Formats the procedure portable and laterality similar to "Portable/Laterality".
 /// Name is formatted according to the default person name format as specified in <see cref="FormatSettings"/>
 /// </summary>
 /// <remarks>
 /// Valid format specifiers are as follows:
 ///     %P - portable
 ///     %L - laterality
 /// </remarks>
 /// <param name="portable"></param>
 /// <param name="laterality"></param>
 /// <returns></returns>
 public static string FormatModifier(bool portable, EnumValueInfo laterality)
 {
     return(FormatModifier(portable, laterality, FormatSettings.Default.ProcedurePortableLateralityDefaultFormat));
 }
示例#35
0
        /// <summary>
        /// Create a random order on the specified visit.
        /// </summary>
        /// <param name="visit">Visit/patient for which the order is created.</param>
        /// <param name="informationAuthority">Performing facility will be selected to match this information authority.</param>
        /// <param name="diagnosticServiceName">Name of the diagnostic service to order.</param>
        /// <param name="schedulingOffsetDays">A positive or negative number of days from today.</param>
        /// <param name="modalityName">The name of the modality.</param>
        /// <param name="facilityCode">The code of the ordering and performing facility.</param>
        /// <param name="laterality">The procedure laterality.</param>
        /// <returns></returns>
        public static OrderSummary RandomOrder(VisitSummary visit, EnumValueInfo informationAuthority, string diagnosticServiceName, int schedulingOffsetDays, string modalityName, string facilityCode, EnumValueInfo laterality)
        {
            InitReferenceDataCacheOnce();

            var scheduledTime = Platform.Time + TimeSpan.FromDays(schedulingOffsetDays);
            LoadDiagnosticServicePlanResponse dsResponse = null;
            OrderSummary orderSummary = null;

            Platform.GetService(
                delegate(IOrderEntryService service)
            {
                DiagnosticServiceSummary diagnosticService;
                if (String.IsNullOrEmpty(diagnosticServiceName) && String.IsNullOrEmpty(modalityName))
                {
                    diagnosticService = ChooseRandom(_diagnosticServices);
                    dsResponse        = service.LoadDiagnosticServicePlan(new LoadDiagnosticServicePlanRequest(diagnosticService.DiagnosticServiceRef));
                }
                else
                {
                    diagnosticService = CollectionUtils.SelectFirst(_diagnosticServices,
                                                                    delegate(DiagnosticServiceSummary ds)
                    {
                        dsResponse = service.LoadDiagnosticServicePlan(new LoadDiagnosticServicePlanRequest(ds.DiagnosticServiceRef));
                        return((ds.Name == diagnosticServiceName) ||
                               (!String.IsNullOrEmpty(modalityName) && (CollectionUtils.SelectFirst(dsResponse.DiagnosticServicePlan.ProcedureTypes,
                                                                                                    ptd => ptd.Name.IndexOf(modalityName) == 0) != null)));
                    });

                    if (diagnosticService == null)
                    {
                        throw new Exception(String.Format("Cannot find diagnostic service with name {0}", diagnosticServiceName));
                    }
                }

                var performingFacility = CollectionUtils.SelectFirst(_orderEntryFormData.FacilityChoices,
                                                                     delegate(FacilitySummary facility)
                {
                    if (facilityCode == null)
                    {
                        return(facility.InformationAuthority.Code == informationAuthority.Code);
                    }

                    return(facility.Code == facilityCode);
                });

                var randomPhysician = ChooseRandom(_practitioners);
                var randomPriority  = ChooseRandom(_orderEntryFormData.OrderPriorityChoices);

                var requisition = new OrderRequisition
                {
                    Patient               = visit.Patient,
                    Visit                 = visit,
                    DiagnosticService     = diagnosticService,
                    OrderingPractitioner  = randomPhysician,
                    OrderingFacility      = performingFacility,
                    Priority              = randomPriority,
                    ReasonForStudy        = "Randomly generated test order",
                    SchedulingRequestTime = scheduledTime,
                    Procedures            = new List <ProcedureRequisition>(),
                    ResultRecipients      = new List <ResultRecipientDetail>(),
                    Attachments           = new List <AttachmentSummary>(),
                    Notes                 = new List <OrderNoteDetail>()
                };

                requisition.Procedures.AddRange(
                    CollectionUtils.Map(dsResponse.DiagnosticServicePlan.ProcedureTypes,
                                        (ProcedureTypeSummary rpt) => new ProcedureRequisition(rpt, performingFacility)
                {
                    ScheduledTime     = scheduledTime,
                    Laterality        = laterality,
                    ScheduledDuration = 30                                                                                                             // default to a non-zero scheduled duration
                }));

                var response = service.PlaceOrder(new PlaceOrderRequest(requisition));

                orderSummary = response.Order;
            });

            return(orderSummary);
        }
        public ProcedureTypeGroupSummary GetProcedureTypeGroupSummary(ProcedureTypeGroup rptGroup, IPersistenceContext context)
        {
            EnumValueInfo category = GetCategoryEnumValueInfo(rptGroup.GetType());

            return(new ProcedureTypeGroupSummary(rptGroup.GetRef(), rptGroup.Name, rptGroup.Description, category));
        }
示例#37
0
		private void UpdatePriority(ReportingProcedureStep step, EnumValueInfo priority)
		{
			if (priority == null)
				return;

			// update the priority of the associated order
			step.Procedure.Order.Priority = EnumUtils.GetEnumValue<OrderPriority>(priority);
		}
示例#38
0
 /// <summary>
 /// Creates a new visit for the specified patient.
 /// </summary>
 /// <param name="patientRef">Patient for which the visit is created.</param>
 /// <param name="informationAuthority">Information authority to use for the visit number.</param>
 /// <param name="admitOffsetDays">A positive or negative number of days from today.</param>
 /// <returns></returns>
 public static VisitSummary CreateVisit(PatientProfileSummary patientProfile, EnumValueInfo informationAuthority, int admitOffsetDays)
 {
     return(CreateVisit(patientProfile, informationAuthority, admitOffsetDays, null));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dialogMode">Indicates whether the component will be shown in a dialog box or not</param>
 public ProcedureTypeGroupSummaryComponent(bool dialogMode)
     : base(dialogMode)
 {
     _filterNone      = new EnumValueInfo(SR.DummyItemNone, SR.DummyItemNone);
     _categoryChoices = new List <EnumValueInfo>();
 }
        private static void PlaceRandomOrderForPatient(PatientProfileSummary patientProfile, EnumValueInfo informationAuthority)
        {
            // find a random active visit, or create one
            var randomVisit = GetActiveVisitForPatient(patientProfile.PatientRef, informationAuthority) ??
                              RandomUtils.CreateVisit(patientProfile, informationAuthority, 0);

            // create the order
            RandomUtils.RandomOrder(randomVisit, informationAuthority, null, 0);
        }
示例#41
0
 /// <summary>
 /// Create a random order on the specified visit.
 /// </summary>
 /// <param name="visit">Visit/patient for which the order is created.</param>
 /// <param name="informationAuthority">Performing facility will be selected to match this information authority.</param>
 /// <param name="diagnosticServiceName">Name of the diagnostic service to order.</param>
 /// <param name="schedulingOffsetDays">A positive or negative number of days from today.</param>
 /// <returns></returns>
 public static OrderSummary RandomOrder(VisitSummary visit, EnumValueInfo informationAuthority, string diagnosticServiceName, int schedulingOffsetDays)
 {
     return(RandomOrder(visit, informationAuthority, diagnosticServiceName, schedulingOffsetDays, "", null, null));
 }
 public ListProcedureTypeGroupsRequest(EnumValueInfo categoryFilter, SearchResultPage page)
     : base(page)
 {
     this.CategoryFilter = categoryFilter;
 }