Skip to content

Commit

Permalink
#599 : MWL Feed from HL7 Order Message: optionally extract Scheduled …
Browse files Browse the repository at this point in the history
…Station AE Title from ORC-18
  • Loading branch information
vrindanayak committed Mar 24, 2017
1 parent 5882feb commit 1353007
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,11 @@ attributetype ( 1.2.40.0.13.1.15.110.3.166 NAME 'dcmAuditUnknownPatientID'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )

attributetype ( 1.2.40.0.13.1.15.110.3.167 NAME 'hl7ScheduledStationAETInOrder'
DESC 'Specifies location of Scheduled Station AE Title in received HL7 Order message. Enumerated values: ORC_18. Not effective for HL7 v2.5.1 OMI^O23 with IPC segment. If absent or no value is provided in the configured field, the Scheduled Station AE Title is selected according configured rules.'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )

objectclass ( 1.2.40.0.13.1.15.110.4.4 NAME 'dcmArchiveDevice'
DESC 'DICOM Archive Device related information'
Expand Down Expand Up @@ -1067,6 +1072,7 @@ objectclass ( 1.2.40.0.13.1.15.110.4.4 NAME 'dcmArchiveDevice'
hl7ImportReportTemplateURI $
hl7ScheduleProcedureTemplateURI $
hl7ScheduledProtocolCodeInOrder $
hl7ScheduledStationAETInOrder $
hl7LogFilePattern $
hl7ErrorLogFilePattern $
dcmUnzipVendorDataToURI $
Expand Down Expand Up @@ -1186,6 +1192,7 @@ objectclass ( 1.2.40.0.13.1.15.110.4.11 NAME 'dcmArchiveHL7Application'
hl7ImportReportTemplateURI $
hl7ScheduleProcedureTemplateURI $
hl7ScheduledProtocolCodeInOrder $
hl7ScheduledStationAETInOrder $
hl7LogFilePattern $
hl7ErrorLogFilePattern $
dicomAETitle ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.dcm4che3.net.hl7.HL7Application;
import org.dcm4chee.arc.conf.ArchiveHL7ApplicationExtension;
import org.dcm4chee.arc.conf.ScheduledProtocolCodeInOrder;
import org.dcm4chee.arc.conf.ScheduledStationAETInOrder;

import javax.json.stream.JsonParser;

Expand All @@ -32,6 +33,7 @@ public void storeTo(HL7Application hl7App, Device device, JsonWriter writer) {
writer.writeNotNull("hl7ErrorLogFilePattern", ext.getHl7ErrorLogFilePattern());
writer.writeNotNull("dicomAETitle", ext.getAETitle());
writer.writeNotNull("hl7ScheduledProtocolCodeInOrder", ext.getHl7ScheduledProtocolCodeInOrder());
writer.writeNotNull("hl7ScheduledStationAETInOrder", ext.getHl7ScheduledStationAETInOrder());
JsonArchiveConfiguration.writeHL7ForwardRules(writer, ext.getHL7ForwardRules());
JsonArchiveConfiguration.writeScheduledStations(writer, ext.getHL7OrderScheduledStations());
JsonArchiveConfiguration.writeHL7OrderSPSStatus(writer, ext.getHL7OrderSPSStatuses());
Expand Down Expand Up @@ -78,6 +80,9 @@ private void loadFrom(ArchiveHL7ApplicationExtension ext, JsonReader reader, Con
case "hl7ScheduledProtocolCodeInOrder":
ext.setHl7ScheduledProtocolCodeInOrder(ScheduledProtocolCodeInOrder.valueOf(reader.stringValue()));
break;
case "hl7ScheduledStationAETInOrder":
ext.setHl7ScheduledStationAETInOrder(ScheduledStationAETInOrder.valueOf(reader.stringValue()));
break;
case "hl7ForwardRule":
JsonArchiveConfiguration.loadHL7ForwardRules(ext.getHL7ForwardRules(), reader);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ protected void storeTo(Device device, JsonWriter writer) {
writer.writeNotNull("hl7ADTSendingApplication", arcDev.getHl7ADTSendingApplication());
writer.writeNotEmpty("hl7ADTReceivingApplication", arcDev.getHl7ADTReceivingApplication());
writer.writeNotNull("hl7ScheduledProtocolCodeInOrder", arcDev.getHl7ScheduledProtocolCodeInOrder());
writer.writeNotNull("hl7ScheduledStationAETInOrder", arcDev.getHl7ScheduledStationAETInOrder());
writer.writeNotNull("dcmAuditUnknownStudyInstanceUID", arcDev.getAuditUnknownStudyInstanceUID());
writer.writeNotNull("dcmAuditUnknownPatientID", arcDev.getAuditUnknownPatientID());
writeAttributeFilters(writer, arcDev);
Expand Down Expand Up @@ -900,6 +901,9 @@ private void loadFrom(ArchiveDeviceExtension arcDev, JsonReader reader, List<Con
case "hl7ScheduledProtocolCodeInOrder":
arcDev.setHl7ScheduledProtocolCodeInOrder(ScheduledProtocolCodeInOrder.valueOf(reader.stringValue()));
break;
case "hl7ScheduledStationAETInOrder":
arcDev.setHl7ScheduledStationAETInOrder(ScheduledStationAETInOrder.valueOf(reader.stringValue()));
break;
case "dcmAuditUnknownStudyInstanceUID":
arcDev.setAuditUnknownStudyInstanceUID(reader.stringValue());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ protected void storeTo(Device device, Attributes attrs) {
LdapUtils.storeNotNull(attrs, "hl7ADTSendingApplication", ext.getHl7ADTSendingApplication());
LdapUtils.storeNotEmpty(attrs, "hl7ADTReceivingApplication", ext.getHl7ADTReceivingApplication());
LdapUtils.storeNotNull(attrs, "hl7ScheduledProtocolCodeInOrder", ext.getHl7ScheduledProtocolCodeInOrder());
LdapUtils.storeNotNull(attrs, "hl7ScheduledStationAETInOrder", ext.getHl7ScheduledStationAETInOrder());
LdapUtils.storeNotNull(attrs, "dcmAuditUnknownStudyInstanceUID", ext.getAuditUnknownStudyInstanceUID());
LdapUtils.storeNotNull(attrs, "dcmAuditUnknownPatientID", ext.getAuditUnknownPatientID());
}
Expand Down Expand Up @@ -307,6 +308,8 @@ protected void loadFrom(Device device, Attributes attrs) throws NamingException,
ext.setHl7ADTSendingApplication(LdapUtils.stringValue(attrs.get("hl7ADTSendingApplication"), null));
ext.setHl7ScheduledProtocolCodeInOrder(LdapUtils.enumValue(ScheduledProtocolCodeInOrder.class,
attrs.get("hl7ScheduledProtocolCodeInOrder"), null));
ext.setHl7ScheduledStationAETInOrder(LdapUtils.enumValue(ScheduledStationAETInOrder.class,
attrs.get("hl7ScheduledStationAETInOrder"), null));
ext.setAuditUnknownStudyInstanceUID(LdapUtils.stringValue(attrs.get("dcmAuditUnknownStudyInstanceUID"), null));
ext.setAuditUnknownPatientID(LdapUtils.stringValue(attrs.get("dcmAuditUnknownPatientID"), null));
}
Expand Down Expand Up @@ -494,6 +497,7 @@ protected void storeDiffs(Device prev, Device device, List<ModificationItem> mod
LdapUtils.storeDiff(mods, "hl7ADTReceivingApplication", aa.getHl7ADTReceivingApplication(), bb.getHl7ADTReceivingApplication());
LdapUtils.storeDiff(mods, "hl7ADTSendingApplication", aa.getHl7ADTSendingApplication(), bb.getHl7ADTSendingApplication());
LdapUtils.storeDiff(mods, "hl7ScheduledProtocolCodeInOrder", aa.getHl7ScheduledProtocolCodeInOrder(), bb.getHl7ScheduledProtocolCodeInOrder());
LdapUtils.storeDiff(mods, "hl7ScheduledStationAETInOrder", aa.getHl7ScheduledStationAETInOrder(), bb.getHl7ScheduledStationAETInOrder());
LdapUtils.storeDiff(mods, "dcmAuditUnknownStudyInstanceUID", aa.getAuditUnknownStudyInstanceUID(), bb.getAuditUnknownStudyInstanceUID());
LdapUtils.storeDiff(mods, "dcmAuditUnknownPatientID", aa.getAuditUnknownPatientID(), bb.getAuditUnknownPatientID());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.dcm4che3.net.hl7.HL7Application;
import org.dcm4chee.arc.conf.ArchiveHL7ApplicationExtension;
import org.dcm4chee.arc.conf.ScheduledProtocolCodeInOrder;
import org.dcm4chee.arc.conf.ScheduledStationAETInOrder;

import javax.naming.NamingException;
import javax.naming.directory.Attributes;
Expand Down Expand Up @@ -73,6 +74,7 @@ public void storeTo(HL7Application hl7App, String deviceDN, Attributes attrs) {
LdapUtils.storeNotNull(attrs, "hl7ErrorLogFilePattern", ext.getHl7ErrorLogFilePattern());
LdapUtils.storeNotNull(attrs, "dicomAETitle", ext.getAETitle());
LdapUtils.storeNotNull(attrs, "hl7ScheduledProtocolCodeInOrder", ext.getHl7ScheduledProtocolCodeInOrder());
LdapUtils.storeNotNull(attrs, "hl7ScheduledStationAETInOrder", ext.getHl7ScheduledStationAETInOrder());
}

@Override
Expand Down Expand Up @@ -103,6 +105,8 @@ public void loadFrom(HL7Application hl7App, Attributes attrs)
ext.setAETitle(LdapUtils.stringValue(attrs.get("dicomAETitle"), null));
ext.setHl7ScheduledProtocolCodeInOrder(LdapUtils.enumValue(ScheduledProtocolCodeInOrder.class,
attrs.get("hl7ScheduledProtocolCodeInOrder"), null));
ext.setHl7ScheduledStationAETInOrder(LdapUtils.enumValue(ScheduledStationAETInOrder.class,
attrs.get("hl7ScheduledStationAETInOrder"), null));
}

@Override
Expand Down Expand Up @@ -139,6 +143,7 @@ public void storeDiffs(HL7Application a, HL7Application b,
LdapUtils.storeDiff(mods, "dicomAETitle", aa.getAETitle(), bb.getAETitle());
LdapUtils.storeDiff(mods, "hl7ScheduledProtocolCodeInOrder", aa.getHl7ScheduledProtocolCodeInOrder(),
bb.getHl7ScheduledProtocolCodeInOrder());
LdapUtils.storeDiff(mods, "hl7ScheduledStationAETInOrder", aa.getHl7ScheduledStationAETInOrder(), bb.getHl7ScheduledStationAETInOrder());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public class ArchiveDeviceExtension extends DeviceExtension {
private String[] hl7ADTReceivingApplication = {};
private String hl7ADTSendingApplication;
private ScheduledProtocolCodeInOrder hl7ScheduledProtocolCodeInOrder;
private ScheduledStationAETInOrder hl7ScheduledStationAETInOrder;
private String auditUnknownStudyInstanceUID;
private String auditUnknownPatientID;

Expand Down Expand Up @@ -1447,6 +1448,14 @@ public void setHl7ScheduledProtocolCodeInOrder(ScheduledProtocolCodeInOrder hl7S
this.hl7ScheduledProtocolCodeInOrder = hl7ScheduledProtocolCodeInOrder;
}

public ScheduledStationAETInOrder getHl7ScheduledStationAETInOrder() {
return hl7ScheduledStationAETInOrder;
}

public void setHl7ScheduledStationAETInOrder(ScheduledStationAETInOrder hl7ScheduledStationAETInOrder) {
this.hl7ScheduledStationAETInOrder = hl7ScheduledStationAETInOrder;
}

public String getAuditUnknownStudyInstanceUID() {
return auditUnknownStudyInstanceUID != null
? auditUnknownStudyInstanceUID : "unknownStudy";
Expand Down Expand Up @@ -1576,6 +1585,7 @@ public void reconfigure(DeviceExtension from) {
hl7ADTReceivingApplication = arcdev.hl7ADTReceivingApplication;
hl7ADTSendingApplication = arcdev.hl7ADTSendingApplication;
hl7ScheduledProtocolCodeInOrder = arcdev.hl7ScheduledProtocolCodeInOrder;
hl7ScheduledStationAETInOrder = arcdev.hl7ScheduledStationAETInOrder;
auditUnknownStudyInstanceUID = arcdev.auditUnknownStudyInstanceUID;
auditUnknownPatientID = arcdev.auditUnknownPatientID;
attributeFilters.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class ArchiveHL7ApplicationExtension extends HL7ApplicationExtension{
private String hl7LogFilePattern;
private String hl7ErrorLogFilePattern;
private ScheduledProtocolCodeInOrder hl7ScheduledProtocolCodeInOrder;
private ScheduledStationAETInOrder hl7ScheduledStationAETInOrder;
private final ArrayList<HL7ForwardRule> hl7ForwardRules = new ArrayList<>();
private final ArrayList<HL7OrderScheduledStation> hl7OrderScheduledStations = new ArrayList<>();
private final EnumMap<SPSStatus,HL7OrderSPSStatus> hl7OrderSPSStatuses = new EnumMap<>(SPSStatus.class);
Expand All @@ -80,6 +81,7 @@ public void reconfigure(HL7ApplicationExtension src) {
hl7LogFilePattern = arcapp.hl7LogFilePattern;
hl7ErrorLogFilePattern = arcapp.hl7ErrorLogFilePattern;
hl7ScheduledProtocolCodeInOrder = arcapp.hl7ScheduledProtocolCodeInOrder;
hl7ScheduledStationAETInOrder = arcapp.hl7ScheduledStationAETInOrder;
hl7ForwardRules.clear();
hl7ForwardRules.addAll(arcapp.hl7ForwardRules);
hl7OrderScheduledStations.clear();
Expand Down Expand Up @@ -258,4 +260,18 @@ public ScheduledProtocolCodeInOrder hl7ScheduledProtocolCodeInOrder() {
: StringUtils.maskNull(getArchiveDeviceExtension().getHl7ScheduledProtocolCodeInOrder(),
ScheduledProtocolCodeInOrder.OBR_4_4);
}

public ScheduledStationAETInOrder getHl7ScheduledStationAETInOrder() {
return hl7ScheduledStationAETInOrder;
}

public void setHl7ScheduledStationAETInOrder(ScheduledStationAETInOrder hl7ScheduledStationAETInOrder) {
this.hl7ScheduledStationAETInOrder = hl7ScheduledStationAETInOrder;
}

public ScheduledStationAETInOrder hl7ScheduledStationAETInOrder() {
return hl7ScheduledStationAETInOrder != null
? hl7ScheduledStationAETInOrder
: getArchiveDeviceExtension().getHl7ScheduledStationAETInOrder();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* *** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is part of dcm4che, an implementation of DICOM(TM) in
* Java(TM), hosted at https://github.com/gunterze/dcm4che.
*
* The Initial Developer of the Original Code is
* J4Care.
* Portions created by the Initial Developer are Copyright (C) 2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* See @authors listed below
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* *** END LICENSE BLOCK *****
*/

package org.dcm4chee.arc.conf;

/**
* @author Vrinda Nayak <vrinda.nayak@j4care.com>
* @since Mar 2017
*/
public enum ScheduledStationAETInOrder {
ORC_18
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ private void updateProcedure(HL7Application hl7App, Socket s, UnparsedHL7Message
@Override
public void setup(Transformer tr) {
tr.setParameter("hl7ScheduledProtocolCodeInOrder", arcHL7App.hl7ScheduledProtocolCodeInOrder().toString());
tr.setParameter("hl7MsgType", msh.getMessageType());
if (arcHL7App.hl7ScheduledStationAETInOrder() != null)
tr.setParameter("hl7ScheduledStationAETInOrder", arcHL7App.hl7ScheduledStationAETInOrder().toString());
}
});
boolean result = adjust(attrs, arcHL7App, msh, s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,14 @@
"OBR_4_4"
]
},
"hl7ScheduledStationAETInOrder": {
"title": "HL7 Schedule Station AET in Order",
"description": "Specifies location of Scheduled Station AE Title in received HL7 Order message. Enumerated values: ORC_18. Not effective for HL7 v2.5.1 OMI^O23 with IPC segment. If absent or no value is provided in the configured field, the Scheduled Station AE Title is selected according configured rules.",
"type": "string",
"enum": [
"ORC_18"
]
},
"hl7LogFilePattern": {
"title": "HL7 Log File Pattern",
"description": "Path to HL7 messages which will be captured exactly as received. If absent, there is no logging.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
"OBR_4_4"
]
},
"hl7ScheduledStationAETInOrder": {
"title": "HL7 Schedule Station AET in Order",
"description": "Specifies location of Scheduled Station AE Title in received HL7 Order message. Enumerated values: ORC_18. Not effective for HL7 v2.5.1 OMI^O23 with IPC segment. If absent or no value is provided in the configured field, the Scheduled Station AE Title is selected according configured rules.",
"type": "string",
"enum": [
"ORC_18"
]
},
"hl7LogFilePattern": {
"title": "HL7 Log File Pattern",
"description": "Path to HL7 messages which will be captured exactly as received. If absent, there is no logging.",
Expand Down

0 comments on commit 1353007

Please sign in to comment.