Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ void testPendingCreatesPlannedMovement() throws Exception {
assertEquals(EVENT_TIME, plannedMovement.getEventDatetime());
assertEquals(PendingType.TRANSFER.toString(), plannedMovement.getEventType());
assertNull(plannedMovement.getCancelledDatetime());
assertEquals("Head and Neck - OMFS", plannedMovement.getHospitalService());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@ public interface PendingEvent {
* @param location Concatenated location string
*/
void setPendingDestination(InterchangeValue<String> location);


/**
* @return Hospital service from PV1-10.
*/
InterchangeValue<String> getHospitalService();

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
public class PendingTransfer extends AdtMessage implements PendingEvent {
private PendingType pendingEventType = PendingType.TRANSFER;
private InterchangeValue<String> pendingDestination = InterchangeValue.unknown();
private InterchangeValue<String> hospitalService = InterchangeValue.unknown();

@Override
public void processMessage(EmapOperationMessageProcessor processor) throws EmapOperationMessageProcessingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ modeOfArrival:
"@class": "uk.ac.ucl.rits.inform.interchange.InterchangeValue"
status: "SAVE"
value: "Walk-in"

hospitalService:
"@class": "uk.ac.ucl.rits.inform.interchange.InterchangeValue"
status: "SAVE"
value: "Head and Neck - OMFS"
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public class PlannedMovement extends TemporalCore<PlannedMovement, PlannedMoveme
@Column(columnDefinition = "timestamp with time zone")
private Instant cancelledDatetime;

/**
* \brief The hospital service associated with this planned movement.
*
* Also know as the subspeciality.
*/
private String hospitalService;

/**
* Minimal constructor.
* @param hospitalVisitId associated hospital visit
Expand All @@ -109,6 +116,7 @@ private PlannedMovement(PlannedMovement other) {
eventDatetime = other.eventDatetime;
cancelled = other.cancelled;
cancelledDatetime = other.cancelledDatetime;
hospitalService = other.hospitalService;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void testPendingTransferSpecificFields() throws Exception {

assertEquals(PendingType.TRANSFER, msg.getPendingEventType());
assertEquals(InterchangeValue.buildFromHl7("1020100166^SDEC BY02^11 SDEC"), msg.getPendingDestination());
assertEquals(InterchangeValue.buildFromHl7("Head and Neck - OMFS"), msg.getHospitalService());
}

/**
Expand All @@ -48,6 +49,18 @@ void testPendingLocationUnknown() throws Exception {
assertTrue(msg.getPendingDestination().isUnknown());
}

/**
* Given a pending transfer message with no hospital service (PV1-10)
* When processed into an interchange message
* The hospital service should be unknown
* @throws Exception
*/
@Test
void testNoHospitalService() throws Exception {
PendingEvent msg = (PendingEvent) processSingleAdtMessage("Adt/pending/A15_no_hospital_service.txt");
assertTrue(msg.getHospitalService().isUnknown());
}

/**
* Given a cancel pending transfer message
* When processed
Expand Down
2 changes: 1 addition & 1 deletion hl7-reader/src/test/resources/Adt/pending/A15.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ PID|1||40800000^^^MRENTR^MEDREC~9999999999^^^NHS^HN||AGBTESTD^Satesta^^^MRS||198
ZPD||Email~MYCH||ACTIVATED|||N||N|||||||||||||||F
PD1|||GP AT HAND^^E85124~~
NTE|1||EP34C Patient|PatComments
PV1|1|E|ED^COVID MAJORS 16^16-COVID MAJORS^U^R^^^^^^DEPID|Emergency|||1236^BEAR^BLACK^^^^^^PROVID^^^^PROVID|||A\T\E|||||||||123412341234|SELF|||||||||||||||||||||Adm*Conf|1020100166^SDEC BY02^11 SDEC^U^D^^^^^^DEPID||20220421195000||||||123412341234
PV1|1|E|ED^COVID MAJORS 16^16-COVID MAJORS^U^R^^^^^^DEPID|Emergency|||1236^BEAR^BLACK^^^^^^PROVID^^^^PROVID|||A\T\E|Head and Neck - OMFS||||||||123412341234|SELF|||||||||||||||||||||Adm*Conf|1020100166^SDEC BY02^11 SDEC^U^D^^^^^^DEPID||20220421195000||||||123412341234
PV2|||||||||||||||||||||n|N||||||||||||||||Walk-in
OBX|1|TX|AdminCode^ADMINISTRATIVE CATEGORY CODE|1|1|||||||||20220422
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MSH|^~\&|EPIC|UCLH|||20220422002300|10018372|ADT^A15|39278859|P|2.4|||AL|NE
EVN|A15|20220422002300||PNDTRANSFER|10018372^GIANT^PANDA^^^^^^UCLHS^^^^^UCHC|20220422002258
PID|1||40800000^^^MRENTR^MEDREC~9999999999^^^NHS^HN||AGBTESTD^Satesta^^^MRS||19800601|F||N|^^London^^T5 1TT||0200 000 0000~07777 000 000||BG|N||123412341234||||||||||||N
ZPD||Email~MYCH||ACTIVATED|||N||N|||||||||||||||F
PD1|||GP AT HAND^^E85124~~
NTE|1||EP34C Patient|PatComments
PV1|1|E|ED^COVID MAJORS 16^16-COVID MAJORS^U^R^^^^^^DEPID|Emergency|||1236^BEAR^BLACK^^^^^^PROVID^^^^PROVID|||A\T\E|||||||||123412341234|SELF|||||||||||||||||||||Adm*Conf|1020100166^SDEC BY02^11 SDEC^U^D^^^^^^DEPID||20220421195000||||||123412341234
PV2|||||||||||||||||||||n|N||||||||||||||||Walk-in
OBX|1|TX|AdminCode^ADMINISTRATIVE CATEGORY CODE|1|1|||||||||20220422
Loading