| @@ -5,11 +5,8 @@ import ca.uhn.hl7v2.HL7Exception; | |||
| import ca.uhn.hl7v2.HapiContext; | |||
| import ca.uhn.hl7v2.model.DataTypeException; | |||
| import ca.uhn.hl7v2.model.Message; | |||
| import ca.uhn.hl7v2.model.v25.datatype.DTM; | |||
| import ca.uhn.hl7v2.model.v251.datatype.FN; | |||
| import ca.uhn.hl7v2.model.v251.group.BAR_P05_PROCEDURE; | |||
| import ca.uhn.hl7v2.model.v251.group.BAR_P05_VISIT; | |||
| import ca.uhn.hl7v2.model.v251.message.ACK; | |||
| import ca.uhn.hl7v2.model.v251.message.ADT_A01; | |||
| import ca.uhn.hl7v2.model.v251.message.BAR_P05; | |||
| import ca.uhn.hl7v2.model.v251.segment.*; | |||
| @@ -17,7 +14,6 @@ import ca.uhn.hl7v2.parser.Parser; | |||
| import ca.uhn.hl7v2.parser.PipeParser; | |||
| import ca.uhn.hl7v2.validation.ValidationContext; | |||
| import ca.uhn.hl7v2.validation.impl.ValidationContextFactory; | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import java.io.BufferedWriter; | |||
| @@ -25,13 +21,13 @@ import java.io.File; | |||
| import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| import java.sql.SQLException; | |||
| import java.sql.Time; | |||
| import java.time.LocalDate; | |||
| import java.time.LocalDateTime; | |||
| import java.time.LocalTime; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import static de.uniluebeck.mi.projmi6.db.DBHandler.getDiagnosenByFall; | |||
| import static de.uniluebeck.mi.projmi6.db.DBHandler.getPatient; | |||
| /** | |||
| @@ -40,13 +36,15 @@ import static de.uniluebeck.mi.projmi6.db.DBHandler.getPatient; | |||
| */ | |||
| public class HL7 { | |||
| /** | |||
| * erstellt eine ADT_A0 nachricht, welche anschließend an die OPS Gruppe verschickt werden soll. | |||
| * TODO Mit OPS Gruppe absprechen, welche Informationen sie auf jeden Fall benötigen und Code entsprechend anpassen. | |||
| * @param fall nach dem Erstellen eines neuen Falls wird diese Methode aufgerufen um Hl7 Nachricht zu erzeugen | |||
| * @throws Exception | |||
| */ | |||
| public void createMessageADTA01( Fall fall) throws HL7Exception, IOException { | |||
| public void createMessageADTA01( Fall fall) throws HL7Exception, IOException, SQLException { | |||
| Patient patient = fall.getPatient (); | |||
| ADT_A01 adt = new ADT_A01 (); | |||
| @@ -88,26 +86,25 @@ public class HL7 { | |||
| pidSegment.getPid13_PhoneNumberHome (0).getTelephoneNumber ().setValue ( patient.getTelefon () ); | |||
| pidSegment.getPid16_MaritalStatus ().getAlternateIdentifier ().setValue ( patient.getFamilienstand ().toString()); | |||
| /* | |||
| //Dg1 (Diagnosen) | |||
| List<DG1> dg1List = new ArrayList<> ( ); | |||
| //Diagnosen | |||
| List<Diagnose> diagnosen = getDiagnosenByFall ( fall ); | |||
| diagnosen.add(fall.getHauptDiagnose ()); | |||
| DG1 dg1Segment = adt.getDG1 (); | |||
| for (Diagnose aDiagnosen : diagnosen) { | |||
| dg1Segment = adt.getDG1 (); | |||
| dg1Segment.getDg12_DiagnosisCodingMethod ().setValue ( "ICD10" ); | |||
| dg1Segment.getDg13_DiagnosisCodeDG1 ().getIdentifier ().setValue ( "CODE" ); | |||
| dg1Segment.getDg14_DiagnosisDescription ().setValue ( aDiagnosen.getFreiText () ); | |||
| dg1List.add ( dg1Segment ); | |||
| if(!diagnosen.isEmpty ()) { | |||
| for (Diagnose diagnose : diagnosen) { | |||
| DG1 dg1Segment = adt.getDG1 (); | |||
| dg1Segment.getDg13_DiagnosisCodeDG1 ().getIdentifier ().parse ( diagnose.getIcd10code ().getCode () ); | |||
| dg1Segment.getDg16_DiagnosisType ().setValue ( String.valueOf ( diagnose.getIcd10code ().getVersion () ) ); | |||
| dg1Segment.getDg116_DiagnosingClinician ()[0].parse ( diagnose.getArzt ().toString () ); | |||
| dg1Segment.getDg14_DiagnosisDescription ().parse ( diagnose.getFreiText () ); | |||
| dg1Segment.getDg16_DiagnosisType ().parse ( diagnose.getDiagArt ().toString () ); | |||
| adt.getDG1All ().add ( dg1Segment ); | |||
| } | |||
| } | |||
| */ | |||
| //print generated message | |||
| printXMLEncodedMessageADT(adt); | |||
| } | |||
| /** | |||
| * | |||
| * @param msg | |||