Пример #1
0
        private void PopulateScheduledProcedureStepSequence(DicomAttributeSQ dicomAttribute, ExamsScheduled row)
        {
            DicomSequenceItem item;

            item = new DicomSequenceItem();

            item[DicomTags.ScheduledStationAeTitle].SetStringValue(row.ScheduledAET);
            item[DicomTags.ScheduledProcedureStepStartDate].SetStringValue(GetDateStringOnly(row.ExamScheduledDateAndTime));
            item[DicomTags.ScheduledProcedureStepStartTime].SetStringValue(GetTimeStringOnly(row.ExamScheduledDateAndTime));
            item[DicomTags.Modality].SetStringValue(row.Modality);
            item[DicomTags.PerformedProcedureStepId].SetStringValue(string.Format("{0}",row.ProcedureStepID));//O M K supported
            item[DicomTags.ScheduledProcedureStepLocation].SetStringValue(row.ExamRoom);//return type 2 -O M K supported
            item[DicomTags.ScheduledProcedureStepDescription].SetStringValue(row.ExamDescription);//return type 2 -O M K supported
            dicomAttribute.AddSequenceItem(item);            
        }
Пример #2
0
        /// <summary>
        /// Populate data from a <see cref="ExamsScheduledBroker"/> entity into a DICOM C-FIND-RSP message.
        /// </summary>
        /// <param name="response">The response message to populate with results.</param>
        /// <param name="tagList">The list of tags to populate.</param>
        /// <param name="row">The <see cref="Patient"/> table to populate from.</param>
        private void PopulateResponse(DicomMessage response, IList<uint> tagList, ExamsScheduled row,string specificCharacterSet)
        {
            DicomAttributeCollection dataSet = response.DataSet;

            dataSet[DicomTags.RetrieveAeTitle].SetStringValue(this._assocParameters.CalledAE);
            dataSet[DicomTags.SopClassUid].SetStringValue(SopClass.ModalityWorklistInformationModelFindUid);
            dataSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID);


            if (tagList.Contains(DicomTags.SpecificCharacterSet))
            {
                dataSet[DicomTags.SpecificCharacterSet].SetStringValue(specificCharacterSet);
                dataSet.SpecificCharacterSet = specificCharacterSet; // this will ensure the data is encoded using the specified character set
            }

            foreach (uint tag in tagList)
            {
                try
                {
                    switch (tag)
                    {
                        case DicomTags.QueryRetrieveLevel:
                            dataSet[DicomTags.QueryRetrieveLevel].SetStringValue("WORKLIST");
                            break;

                        //Scheduled Procedure Step module required retrun keys
                        case DicomTags.ScheduledProcedureStepSequence:
                            PopulateScheduledProcedureStepSequence(dataSet[DicomTags.ScheduledProcedureStepSequence] as DicomAttributeSQ, row);
                            break;

                        // Requested Procedure
                        case DicomTags.RequestedProcedureId:
                            dataSet[DicomTags.RequestedProcedureId].SetStringValue(string.Format("{0}",row.ProcedureID));
                            break;
                        case DicomTags.RequestedProcedureDescription:
                            dataSet[DicomTags.RequestedProcedureDescription].SetStringValue(row.ExamDescription);
                            break;
                        case DicomTags.StudyInstanceUid:
                            // The mwl is supposed to generate the StudyInstanceUID;
                            // and may update back (or not the modality worklist)
                            dataSet[DicomTags.StudyInstanceUid].SetStringValue(DicomUid.GenerateUid().UID);
                            break;
                        case DicomTags.ReferencedStudySequence:
                            dataSet[DicomTags.ReferencedStudySequence].SetNullValue();
                            break;
                        case DicomTags.RequestedProcedurePriority:
                            dataSet[DicomTags.RequestedProcedurePriority].SetStringValue("N/A");
                            break;
                        case DicomTags.PatientTransportArrangements:
                            dataSet[DicomTags.PatientTransportArrangements].SetStringValue("N/A");
                            break;
                        //Imaging Service Request
                        case DicomTags.AccessionNumber:                           
                            dataSet[DicomTags.AccessionNumber].SetStringValue(string.Format("{0}",row.AccessionNumber));
                            break;
                        case DicomTags.RequestingPhysician:
                            dataSet[DicomTags.RequestingPhysician].SetStringValue("");
                            break;
                        case DicomTags.ReferringPhysiciansName:
                            dataSet[DicomTags.ReferringPhysiciansName].SetStringValue(row.ReferringPhysician);
                            break;
                        //Visit Identification
                        case DicomTags.AdmissionId:
                            dataSet[DicomTags.AdmissionId].SetStringValue("");
                            break;
                        //Visit Status
                        case DicomTags.CurrentPatientLocation:
                            dataSet[DicomTags.CurrentPatientLocation].SetStringValue("");
                            break;

                        //Visit Relationship required retrun keys
                        case DicomTags.ReferencedSopClassUid:
                            dataSet[DicomTags.ReferencedSopClassUid].SetStringValue(SopClass.ModalityWorklistInformationModelFindUid);
                            break;
                        case DicomTags.ReferencedSopInstanceUid:
                            dataSet[DicomTags.ReferencedSopInstanceUid].SetStringValue(response.AffectedSopInstanceUid);
                            break;
                        case DicomTags.ReferencedPatientSequence:
                            dataSet[DicomTags.ReferencedPatientSequence].SetNullValue();
                            break;

                        //Patient Identification
                        case DicomTags.PatientsName:
                            dataSet[DicomTags.PatientsName].SetStringValue(row.FullName);
                            break;
                        case DicomTags.PatientId:
                            dataSet[DicomTags.PatientId].SetStringValue(string.Format("{0}",row.PatientID));
                            break;
                        //Patient Demographic
                        case DicomTags.PatientsBirthDate:
                            dataSet[DicomTags.PatientsBirthDate].SetStringValue("");
                            break;
                        case DicomTags.PatientsSex:
                            dataSet[DicomTags.PatientsSex].SetStringValue(row.Sex);
                            break;

                        case DicomTags.ConfidentialityConstraintOnPatientDataDescription:
                            dataSet[DicomTags.ConfidentialityConstraintOnPatientDataDescription].SetStringValue("");
                            break;
                        case DicomTags.PatientsWeight:
                            dataSet[DicomTags.PatientsWeight].SetStringValue("");
                            break;
                        //Patient Medical
                        case DicomTags.PatientState:
                            dataSet[DicomTags.PatientState].SetStringValue("");
                            break;
                        case DicomTags.PregnancyStatus:
                            dataSet[DicomTags.PregnancyStatus].SetStringValue("");
                            break;
                        case DicomTags.MedicalAlerts:
                            dataSet[DicomTags.MedicalAlerts].SetStringValue("");
                            break;
                        case DicomTags.Allergies:
                            dataSet[DicomTags.Allergies].SetStringValue("");
                            break;
                        case DicomTags.SpecialNeeds:
                            dataSet[DicomTags.SpecialNeeds].SetStringValue("");
                            break;
                        default:
                            dataSet[tag].SetNullValue();
                            break;
                    }
                }
                catch (Exception e)
                {
                    Platform.Log(LogLevel.Warn, e, "Unexpected error setting tag {0} in C-FIND-RSP",
                                 dataSet[tag].Tag.ToString());
                    dataSet[tag].SetNullValue();
                }
            }
        }