Skip to content

Prefetch Studies on receive of HL7 messages

Vrinda edited this page Mar 27, 2023 · 1 revision

Overview

One can choose to prefetch some or all studies of a patient from an external archive on receive of HL7 messages for the patient specified in PID-3 of received HL7 message.

Flow Diagram

Prefetch for Assigning Authority of Patient ID logic

Computing Scheduled Time for Retrieve Tasks

Configuration

Configure a Remote Application Entity for :

  • C-FIND SCP which is queried for Studies matching the specified Entity Selector
  • C-MOVE SCP from which selected Studies are retrieved
  • C-STORE SCP to which selected Studies are retrieved. (Note: This retrieve destination may be configured as own archive and/or external destination.

Using Archive UI

  • Select the level on which the feature needs to be configured :
    • To configure on Archive device level, go to Menu -> Configuration -> Devices -> dcm4chee-arc -> Extensions -> Device Extension (Edit)-> Archive device extension (Edit).
    • To configure on Archive HL7 application extension level, go to Menu -> Configuration -> Devices -> dcm4chee-arc -> Extensions -> Device Extension (Edit) -> Child Objects. Select the HL7 application for which this feature needs to be configured. Go to its Extensions -> Archive HL7 Application extension (Edit).
  • In its Child Objects add HL7 Prefetch Rule. Specify Name, Queue Name, Prefetch Priority, Archive AE title, Prefetch C-Find SCP, Prefetch C-Move SCP, Prefetch C-Store SCP, Suppress Duplicate Retrieve Interval and Save.

Doing so will trigger prefetch of studies for patients (referenced in PID-3) whenever any accepted and acknowledged HL7 Message is received by the archive.

HL7 Prefetch Rule optional attributes use cases

  1. Trigger prefetch of studies only for specific HL7 message(s) conditions.
  • Add one or more Conditions and Save.

    This ensures that studies of patient(s) referenced in processed HL7 Message(s) shall be prefetched only if conditions specified match with the information available in the incoming HL7 Message.

  1. Trigger prefetch only for some studies based on certain conditions pertaining to the study/patient
  • Add one or more Entity Selector and Save.

    For eg. if you set value as priors=2&StudyAge=-5Y&ModalitiesInStudy=CT, it means select at most 2 prior Studies not older than 5 years containing at least one CT Series.

  1. Always ignore the Issuer of Patient ID present in incoming HL7 message(s)
  • Select Ignore Assigning Authority of Patient ID as ALWAYS and Save.

    This ensures that Issuer of Patient ID present in incoming HL7 message(s) will not be considered to check for studies of this patient to be prefetched from the external archive.

  1. Prefetch studies of patient(s) only for a certain set of Matching or Non Matching Issuer of Patient ID(s)
  • Select Ignore Assigning Authority of Patient ID as MATCHING or NON_MATCHING. Add one or more Assigning Authority of Patient ID and Save.

    This ensures that only the Matching or Non Matching Issuer of Patient ID(s) configured shall be matched with ones present in incoming HL7 message(s) and then for these patient(s) studies will be prefetched from external archive.

  1. Prefetch Studies only at certain scheduled times. eg. pre-fetch in off business hours or at scheduled arrival/examination of patient or some duration in advance before the patient is scheduled for arrival/examination. See Computing Scheduled Time for Retrieve Tasks
  • Configure either of
    • Prefetch Date Time Field :
    • Prefetch Date Time Field together with Prefetch In Advance :
    • (optionally with) one or more Prefetch Schedule :
      and Save.
  1. Configure Prefetch for Assigning Authority of Patient ID if your application receives PID-3 with list of qualified patient identifiers, and the desired qualified patient identifier is not necessarily present in PID:3.1 and PID:3.4

Using LDAP

One may either create a LDIF file (e.g.):

  • To configure on Archive device level,

      version: 1
      dn: cn=Default HL7 Prefetch Rule,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      objectClass: hl7PrefetchRule
      cn: Default HL7 Prefetch Rule
      dcmDuration: PT1H
      dicomAETitle: DCM4CHEE
      dcmPrefetchCFindSCP: EXT_ARCHIVE_AET
      dcmPrefetchCMoveSCP: EXT_ARCHIVE_AET
      dcmPrefetchCStoreSCP: STORESCP
      dcmProperty: MSH-3=FORWARD
      dcmEntitySelector: priors=2&StudyAge=-5Y&ModalitiesInStudy=CT
      dcmNullifyIssuerOfPatientID: MATCHING
      dcmIssuerOfPatientID: CANCER-HOSPITAL-ISSUER&1.2.40.0.13.1.1.999.111.11113&ISO
    
  • To configure on Archive HL7 application level,

      version: 1
      dn: cn=Default HL7 Prefetch Rule,hl7ApplicationName=DCM4CHEE|HL7APP,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      objectClass: hl7PrefetchRule
      cn: Default HL7 Prefetch Rule
      dcmDuration: PT1H
      dicomAETitle: DCM4CHEE
      dcmPrefetchCFindSCP: EXT_ARCHIVE_AET
      dcmPrefetchCMoveSCP: EXT_ARCHIVE_AET
      dcmPrefetchCStoreSCP: STORESCP
      dcmProperty: MSH-3=FORWARD
      dcmEntitySelector: priors=2&StudyAge=-5Y&ModalitiesInStudy=CT
      dcmNullifyIssuerOfPatientID: MATCHING
      dcmIssuerOfPatientID: CANCER-HOSPITAL-ISSUER&1.2.40.0.13.1.1.999.111.11113&ISO
    

    and import it to the LDAP Server by using the ldapmodify command line utility.

  • or directly use its New Entry... function to create corresponding HL7 Prefetch Rule entries of Apache Directory Studio on Device Level (e.g.: dicomDeviceName=dcm4chee-arc) or on Archive HL7 Application Level (e.g: hl7ApplicationName=DCM4CHEE|HL7APP) of the Archive Configuration.

One may refer to HL7 Prefetch Rule to understand the description of attributes.

Refer ISO-8601 Duration format for more know-how on Durations.

Go to the Control tab on Configuration page in archive UI and reload the configuration.

Testing

Required dcm4che Tools

  • hl7snd simulating the HL7 Sender (e.g. DSS/Order Filler), which sends the HL7 messages to archive.
  • storescp simulating the external object destination STORESCP, to which received objects are forwarded.

Verification

  1. Start STORESCP tool.

       storescp -b <AET>:<port>
    
  2. Send HL7 message to the archive for the same patient.

       hl7snd -c <hostname>:<port>  /pathToHL7Msg
    
  3. It can be seen in the storescp tool window that the studies of this patient have been retrieved from the external archive and exported to the STORESCP destination.

Clone this wiki locally