/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "carevue.h" #include "cvgateway.h" #include "ADT_A12msg.h" #ifdef CAREVUE_F_VERSION /* * CareVue F version didn't support A02 to be a transfer within the same * careunit. */ #include "ADT_A26msg.h" HL7Message *cancel_transfer(HL7Message &msg) { ADT_A12msg &request = (ADT_A12msg &)msg; request.MesHea.RecApp = "ADT"; request.HpConFigDem = assemble_zdm(request.PatIde, request.PatVisit); fix_pid(request.PatIde, request.PatVisit); if(request.PatVisit.AssPatLoc.NurseUnit == RecFac) // i.e. our CareUnit { ADT_A26msg hp_move; hp_move.MesHea = request.MesHea; hp_move.EventType = request.EventType; hp_move.PatIde = request.PatIde; hp_move.PatVisit = request.PatVisit; hp_move.HpConFigDem = request.HpConFigDem; IDtyp new_bed = hp_move.PatVisit.AssPatLoc.Bed; /* * 1. Move patient out */ hp_move.PatVisit.AssPatLoc.Bed.unset(); delete forward_message(hp_move); /* * 2. Move patient back in */ hp_move.PatVisit.AssPatLoc.Bed = new_bed; return forward_message(hp_move); } else return forward_message(request); } #else /* !CAREVUE_F_VERSION */ HL7Message *cancel_transfer(HL7Message &msg) { ADT_A12msg &request = (ADT_A12msg &)msg; request.MesHea.RecApp = "ADT"; request.HpConFigDem = assemble_zdm(request.PatIde, request.PatVisit); fix_pid(request.PatIde, request.PatVisit); request.PatVisit.DisDis = dis2hp(request.PatVisit.DisDis); return forward_message(request); } #endif /* !CAREVUE_F_VERSION */