// String zipCode = new String();
// String street = new String();
// String town = new String();
// String birthday = new String();
// String gender = new String();
String anamnese = new String("Anamnese");
String subject = new String();
// String insurance = new String();
String objectText = new String();
String overlayName = new String();
Vector xCoordinates = new Vector();
Vector yCoordinates = new Vector();
String assessment = new String();
String plan = new String();
String problemName = new String();
org.resmedicinae.resmedlib.term.String problemId = new org.resmedicinae.resmedlib.term.String();
String partialContactId = new String();
String partialContactDate = new String();
String partialContactNumber = new String();
int partialContactNumberAsInt = 0;
// String image = new String();
//String tempCaveId = new String("0");
//String tempProblemId = new String("0");
//String tempEpisodeId = new String("0");
//String tempPartialContactId = new String("0");
// String tempSubjectId = new String("0");
// String tempObjectId = new String("0");
// String tempAssessmentId = new String("0");
//String tempPlanId = new String("0");
//get the name of healthRecord and so on....
HealthRecord healthRecord = new HealthRecord();
healthRecord.setIdentifier(getTagDataFromDocument(doc, "HealthRecordId"));
healthRecord.setName(getTagDataFromDocument(doc, "Name"));
System.out.println("+++++++++++++++++++++++Getting first name: " + (getTagDataFromDocument(doc, "FirstName")).getValue());
healthRecord.setFirstName(getTagDataFromDocument(doc, "FirstName"));
healthRecord.setBirthday(getTagDataFromDocument(doc, "Birthday"));
healthRecord.setGender(getTagDataFromDocument(doc, "Gender"));
healthRecord.setStreet(getTagDataFromDocument(doc, "Street"));
healthRecord.setZipCode(getTagDataFromDocument(doc, "ZipCode"));
healthRecord.setTown(getTagDataFromDocument(doc, "Town"));
healthRecord.setCountry(getTagDataFromDocument(doc, "Country"));
healthRecord.setPhoneNumber(getTagDataFromDocument(doc, "PhoneNumber"));
healthRecord.setInsurance(getTagDataFromDocument(doc, "Insurance"));
healthRecord.setInsuranceNumber(getTagDataFromDocument(doc, "InsuranceNumber"));
healthRecord.setBloodType(getTagDataFromDocument(doc, "BloodType"));
healthRecord.setHeight(getTagDataFromDocument(doc, "Height"));
healthRecord.setWeight(getTagDataFromDocument(doc, "Weight"));
NodeList caveElementList = doc.getElementsByTagName("Cave");
for (int cavesIndex = 0; cavesIndex < caveElementList.getLength(); cavesIndex++) {
NodeList cavePropertyNodeList = caveElementList.item(cavesIndex).getChildNodes();
Cave cave = new Cave();
cave.initialize();
for (int cavePropertyIndex = 0; cavePropertyIndex < cavePropertyNodeList.getLength(); cavePropertyIndex++) {
if (cavePropertyNodeList.item(cavePropertyIndex).getNodeName().equals("CaveID")) {
cave.setIdentifier(new org.resmedicinae.resmedlib.term.String(getNodeValue(cavePropertyNodeList.item(cavePropertyIndex))));
} else if (cavePropertyNodeList.item(cavePropertyIndex).getNodeName().equals("CaveName")) {
cave.setName(new org.resmedicinae.resmedlib.term.String(getNodeValue(cavePropertyNodeList.item(cavePropertyIndex))));
} else if (cavePropertyNodeList.item(cavePropertyIndex).getNodeName().equals("CaveDescription")) {
cave.setDescription(new org.resmedicinae.resmedlib.term.String(getNodeValue(cavePropertyNodeList.item(cavePropertyIndex))));
}
}
healthRecord.set(cave.getIdentifier(), cave);
}
//extraction the problems, getting tags with name "problem"
NodeList elementList = doc.getElementsByTagName("Problem");
/*if there are problems, go on*/
if (elementList.getLength() != 0) {
System.out.println("Jens: Health Record has problems!!!");
for (int i = 0; i < elementList.getLength(); i++) {
Problem problem = new Problem();
//initialization from item
problem.initialize();
if (elementList.item(i).hasChildNodes()) {
//getting all sub elements of one problem, the problem properties
NodeList problemPropertyNodeList = elementList.item(i).getChildNodes();
for (int f = 0; f < problemPropertyNodeList.getLength(); f++) {
//has a property sub elements??? sub elements are ProblemName or ProblemId for example
System.out.println("f: " + f + " problemPropertyNodeList.item(f).getNodeName():" + problemPropertyNodeList.item(f).getNodeName());
// if (problemPropertyNodeList.item(f).hasChildNodes()) {
// problem name is a property
if (problemPropertyNodeList.item(f).getNodeName().equals("ProblemName")) {
if (hasNodeValue(problemPropertyNodeList.item(f))) {
System.out.println("Catching Problem name");
problemName = getNodeValue(problemPropertyNodeList.item(f));
System.out.println("Jens: Catching Problem Name!!!");
}
problem.setName(new org.resmedicinae.resmedlib.term.String(problemName));
} else if (problemPropertyNodeList.item(f).getNodeName().equals("ProblemId")) {
// problem id is a property
if (hasNodeValue(problemPropertyNodeList.item(f))) {
System.out.println("Catching Problem id");
problemId.setValue(getNodeValue(problemPropertyNodeList.item(f)));
}
problem.setIdentifier(problemId);
} else if (problemPropertyNodeList.item(f).getNodeName().equals("Anamnese")) {
System.out.println("<<<<<<<<<<<<<<<<<<<<anamnese: " + anamnese);
if (hasNodeValue(problemPropertyNodeList.item(f))) {
anamnese = getNodeValue(problemPropertyNodeList.item(f));
}
System.out.println("<<<<<<<<<<<<<<<<<<<<anamnese: " + anamnese);
problem.setAnamnese(new org.resmedicinae.resmedlib.term.String(anamnese));
} else if (problemPropertyNodeList.item(f).getNodeName().equals("Episodes")) {
System.out.println("Catching Episodes");
if (problemPropertyNodeList.item(f).hasChildNodes()) {
NodeList episodesNodeList = problemPropertyNodeList.item(f).getChildNodes();
for (int ee = 0; ee < episodesNodeList.getLength(); ee++) {
if ((episodesNodeList.item(ee).getNodeName().equals("Episode")) && (episodesNodeList.item(ee).hasChildNodes())) {
System.out.println("a: " + episodesNodeList.item(ee).getNodeName());
System.out.println("b: " + episodesNodeList.item(ee).hasChildNodes());
NodeList episodePropertyNodeList = episodesNodeList.item(ee).getChildNodes();
Episode episode = new Episode();
for (int tt = 0; tt < episodePropertyNodeList.getLength(); tt++) {
System.out.println("G");
System.out.println("Catching Episode");
if (episodePropertyNodeList.item(tt).getNodeName().equals("EpisodeId")) {
if (hasNodeValue(episodePropertyNodeList.item(tt))) {
String episodeId = getNodeValue(episodePropertyNodeList.item(tt));
episode.setIdentifier(new org.resmedicinae.resmedlib.term.String(episodeId));
}
} else if (episodePropertyNodeList.item(tt).getNodeName().equals("PartialContacts")) {
NodeList partialContactsNodeList = episodePropertyNodeList.item(tt).getChildNodes();
for (int tu = 0; tu < partialContactsNodeList.getLength(); tu++) {
if (partialContactsNodeList.item(tu).getNodeName().equals("PartialContact")) {
System.out.println("Catching Partial Contact");
NodeList partialContactNodeList =
partialContactsNodeList.item(tu).getChildNodes();
PartialContact partialContact = new PartialContact();
//initialization from item
partialContact.initialize();
for (int t = 0; t < partialContactNodeList.getLength(); t++) {
if (partialContactNodeList.item(t).getNodeName().equals("PartialContactId")) {
if (hasNodeValue(partialContactNodeList.item(t))) {
partialContactId = getNodeValue(partialContactNodeList.item(t));
//Construction of an partialContact. add(...) from Item is used as well as
//set...-methods from the business objects (which have to be removed...!!!)
partialContact.setIdentifier(new org.resmedicinae.resmedlib.term.String(partialContactId));
partialContact.setPartialContactNumber(partialContactNumberAsInt);
}
} else if (partialContactNodeList.item(t).getNodeName().equals("PartialContactNumber")) {
if (hasNodeValue(partialContactNodeList.item(t))) {
partialContactNumber = getNodeValue(partialContactNodeList.item(t));
partialContactNumberAsInt =
(Integer.valueOf(partialContactNumber)).intValue();
}
} else if (partialContactNodeList.item(t).getNodeName().equals("PartialContactDate")) {
if (hasNodeValue(partialContactNodeList.item(t))) {
partialContactDate = getNodeValue(partialContactNodeList.item(t));
partialContact.setPartialContactDate(new org.resmedicinae.resmedlib.term.String(partialContactDate));
}
} else if (partialContactNodeList.item(t).getNodeName().equals("Subjective")) {
if (hasNodeValue(partialContactNodeList.item(t))) {
subject = getNodeValue(partialContactNodeList.item(t));
/*Adding the subject*/
System.out.println("Catching subjective");
Subjective soapSubject = new Subjective(subject);
partialContact.set(
new org.resmedicinae.resmedlib.term.String("subjective"), soapSubject);
}
} else if (partialContactNodeList.item(t).getNodeName().equals("Objectives")) {
if (hasNodeValue(partialContactNodeList.item(t))) {
NodeList objectNodeList = partialContactNodeList.item(t).getChildNodes();
for (int oo = 0; oo < objectNodeList.getLength(); oo++) {
if (objectNodeList.item(oo).getNodeName().equals("Objective")) {
if (objectNodeList.item(oo).hasChildNodes()) {
/*Adding the object*/
Objective soapObject = new Objective();
NodeList objectPropertiesList = objectNodeList.item(oo).getChildNodes();
for (int te = 0; te < objectPropertiesList.getLength(); te++) {
if (objectPropertiesList.item(te).getNodeName().equals("ObjectiveID")) {
if (hasNodeValue(objectPropertiesList.item(te))) {
soapObject.setIdentifier(new org.resmedicinae.resmedlib.term.String(getNodeValue(objectPropertiesList.item(te))));
}
} else if (objectPropertiesList.item(te).getNodeName().equals("Text")) {
if (hasNodeValue(objectPropertiesList.item(te))) {
objectText = getNodeValue(objectPropertiesList.item(te));
soapObject.setText(new org.resmedicinae.resmedlib.term.String(objectText));
}
} else if (objectPropertiesList.item(te).getNodeName().equals("OverlayName")) {
if (hasNodeValue(objectPropertiesList.item(te))) {
overlayName = getNodeValue(objectPropertiesList.item(te));
soapObject.setOverlayName(overlayName);
}
} else if (objectPropertiesList.item(te).getNodeName().equals("Markers")) {
String y = new String();
String x = new String();
//new Vector() not clear()!!!!!!
xCoordinates = new Vector();
yCoordinates = new Vector();
NodeList markerList = objectPropertiesList.item(te).getChildNodes();
for (int r = 0; r < markerList.getLength(); r++) {
if (markerList.item(r).getNodeName().equals("Marker")) {
NodeList coordList = markerList.item(r).getChildNodes();
for (int a = 0; a < coordList.getLength(); a++) {
if (coordList.item(a).getNodeName().equals("X")) {
if (hasNodeValue(coordList.item(a))) {
x = getNodeValue(coordList.item(a));
xCoordinates.add(new Integer(x));
}
} else if (coordList.item(a).getNodeName().equals("Y")) {
if (hasNodeValue(coordList.item(a))) {
y = getNodeValue(coordList.item(a));
yCoordinates.add(new Integer(y));
}
}
}
soapObject.setMarkerXCoordinates(xCoordinates);
soapObject.setMarkerYCoordinates(yCoordinates);
}
}
}
}
/*Add another soapObject to vector*/
System.out.println("Catching objective");
partialContact.set(soapObject.getIdentifier(), soapObject);
}
}
}
}
} else if (partialContactNodeList.item(t).getNodeName().equals("Assessment")) {
if (hasNodeValue(partialContactNodeList.item(t))) {
assessment = getNodeValue(partialContactNodeList.item(t));
/*Adding the assessment*/
System.out.println("Catching assessment");
Assessment soapAssessment = new Assessment(assessment);
partialContact.set(
new org.resmedicinae.resmedlib.term.String("assessment"), soapAssessment);
}
} else if (partialContactNodeList.item(t).getNodeName().equals("Plan")) {
Plan soapPlan = new Plan(plan);
NodeList planPropertyNodeList =
partialContactNodeList.item(t).getChildNodes();
for (int ppIndex = 0; ppIndex < planPropertyNodeList.getLength();
ppIndex++) {
if (planPropertyNodeList.item(ppIndex).getNodeName().equals("PlanText")) {
plan = getNodeValue(planPropertyNodeList.item(ppIndex));
soapPlan.setText(new org.resmedicinae.resmedlib.term.String(plan));
} else if (planPropertyNodeList.item(ppIndex).getNodeName().equals("Medications")) {
NodeList medicationsList =
planPropertyNodeList.item(ppIndex).getChildNodes();
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Medication gefunden!!!!!!!");
System.out.println("Medications List ist " +
medicationsList.getLength() + " lang.");
for (int medIndex = 0; medIndex < medicationsList.getLength();
medIndex++) {
if (medicationsList.item(medIndex).getNodeName().equals("Medication")) {
Medication medication = new Medication();
String medicationName = new String();
String medicationDose = new String();
NodeList medicationNodeList =
medicationsList.item(medIndex).getChildNodes();
for (int medicationIndex = 0; medicationIndex < medicationNodeList.getLength();
medicationIndex++) {
if (medicationNodeList.item(medicationIndex).getNodeName().equals("MedicationName")) {