Search in sources :

Example 1 with Modality

use of org.karnak.backend.enums.Modality in project karnak by OsiriX-Foundation.

the class DicomWorkListLogic method query.

public void query(WorkListQueryData queryData) {
    String modalityStr = null;
    Modality modality = queryData.getScheduledModality();
    if (modality != Modality.ALL) {
        modalityStr = modality.name();
    }
    int[] sps = { Tag.ScheduledProcedureStepSequence };
    DicomParam[] RETURN_KEYS = { new DicomParam(Tag.AccessionNumber, queryData.getAccessionNumber()), CFind.IssuerOfAccessionNumberSequence, CFind.ReferringPhysicianName, new DicomParam(Tag.PatientName, queryData.getPatientName()), new DicomParam(Tag.PatientID, queryData.getPatientId()), CFind.IssuerOfPatientID, CFind.PatientBirthDate, CFind.PatientSex, ModalityWorklist.PatientWeight, ModalityWorklist.MedicalAlerts, ModalityWorklist.Allergies, ModalityWorklist.PregnancyStatus, CFind.StudyInstanceUID, ModalityWorklist.RequestingPhysician, ModalityWorklist.RequestingService, ModalityWorklist.RequestedProcedureDescription, ModalityWorklist.RequestedProcedureCodeSequence, new DicomParam(Tag.AdmissionID, queryData.getAdmissionId()), ModalityWorklist.IssuerOfAdmissionIDSequence, ModalityWorklist.SpecialNeeds, ModalityWorklist.CurrentPatientLocation, ModalityWorklist.PatientState, ModalityWorklist.RequestedProcedureID, ModalityWorklist.RequestedProcedurePriority, ModalityWorklist.PatientTransportArrangements, ModalityWorklist.PlacerOrderNumberImagingServiceRequest, ModalityWorklist.FillerOrderNumberImagingServiceRequest, ModalityWorklist.ConfidentialityConstraintOnPatientDataDescription, // Scheduled Procedure Step Sequence
    new DicomParam(sps, Tag.Modality, modalityStr), ModalityWorklist.RequestedContrastAgent, new DicomParam(sps, Tag.ScheduledStationAETitle, queryData.getScheduledStationAet()), new DicomParam(sps, Tag.ScheduledProcedureStepStartDate, getDate(queryData.getScheduledFrom())), new DicomParam(sps, Tag.ScheduledProcedureStepEndDate, getDate(queryData.getScheduledTo())), ModalityWorklist.ScheduledPerformingPhysicianName, ModalityWorklist.ScheduledProcedureStepDescription, ModalityWorklist.ScheduledProcedureStepID, ModalityWorklist.ScheduledStationName, ModalityWorklist.ScheduledProcedureStepLocation, ModalityWorklist.PreMedication, ModalityWorklist.ScheduledProcedureStepStatus, ModalityWorklist.ScheduledProtocolCodeSequence };
    DicomNode workListNode = new DicomNode(queryData.getWorkListAet(), queryData.getWorkListHostname(), queryData.getWorkListPort());
    DicomState state = ModalityWorklist.process(null, new DicomNode(queryData.getCallingAet()), workListNode, 0, RETURN_KEYS);
    view.loadAttributes(state.getDicomRSP());
    if (state != null && state.getStatus() != Status.Success) {
        String errorMsg = "Cannot get a worklist! DICOM error status: " + Integer.toHexString(state.getStatus());
        Message message = new Message(MessageLevel.ERROR, MessageFormat.TEXT, errorMsg);
        view.displayMessage(message);
    }
}
Also used : DicomParam(org.weasis.dicom.param.DicomParam) Message(org.karnak.backend.model.dicom.Message) DicomState(org.weasis.dicom.param.DicomState) Modality(org.karnak.backend.enums.Modality) DicomNode(org.weasis.dicom.param.DicomNode)

Aggregations

Modality (org.karnak.backend.enums.Modality)1 Message (org.karnak.backend.model.dicom.Message)1 DicomNode (org.weasis.dicom.param.DicomNode)1 DicomParam (org.weasis.dicom.param.DicomParam)1 DicomState (org.weasis.dicom.param.DicomState)1