Commit fdff3c99 authored by Tony Schaller's avatar Tony Schaller

Multiple refactorings

- renaming classes that are no longer abstract from Abstract* to Base*
- updated testing scripts
- further bugfixing

git-svn-id: https://svn.code.sf.net/p/ehealthconnector/code/trunk@1692 e99adb7c-5e35-42fd-8d1b-cdb378af05e8
parent 641fc467
......@@ -890,7 +890,7 @@ public class DemoEdes
private String getInfoFromEdpnDemoDocument(CdaChEdesEdpn doc)
{
String retVal = "";
foreach (AbstractVitalSignObservation vitalSign in EnumerableCollection.toEnumerable(doc.getCodedVitalSigns()))
foreach (BaseVitalSignObservation vitalSign in EnumerableCollection.toEnumerable(doc.getCodedVitalSigns()))
{
String signName = vitalSign.getCode().getDisplayName();
String signDateTime = DateUtil.formatDateTimeCh(vitalSign.getEffectiveTime());
......
......@@ -954,10 +954,15 @@ public class DemoLrep
CodeSystems.SwissAL.getCodeSystemName(), "Urin-Teilstatus, 5-10 Parameter"));
code.setOriginalText("pH im Urin");
obs.setCode(code);
// Note: unit definition in the Schema: use="optional" default="1"
// the setUcumUnit("1") call does therefore have no impact on the
// serialized CDA. This is ok!
value = new Value(new java.lang.Integer(6));
value.setUcumUnit("1");
obs.addValue(value);
value = new Value(new BigDecimal(0.5), new BigDecimal(8));
value.setUcumUnit("1TODO");// Unit 1 wird nicht serialisiert...
// This is just to get the CDA valid against the Schematron rules
value.setUcumUnit("dummy");
refRange = new ReferenceRange(value, ObservationInterpretation.NORMAL);
obs.setReferenceRange(refRange);
battery.addLaboratoryObservation(obs);
......@@ -2033,8 +2038,7 @@ public class DemoLrep
obs = new LaboratoryObservation();
code = new Code(CodeSystems.LOINC.getCodeSystemId(), "19153-6",
CodeSystems.LOINC.getCodeSystemName(),
" \r\r\n" + "Volume in Urine collected for unspecified duration");
CodeSystems.LOINC.getCodeSystemName(),"Volume in Urine collected for unspecified duration");
code.setOriginalText("Sammelvolumen");
obs.setCode(code);
value = new Value(new BigDecimal(2400));
......@@ -2629,7 +2633,7 @@ org.ehealth_connector.cda.ch.LaboratorySpecialtySection section in EnumerableCol
{
txtLog.AppendText(" - Battery of "
+ sdfTime.format(organizer.getEffectiveTime()) + "\r\n");
foreach (AbstractObservation obs in EnumerableCollection.toEnumerable(organizer.getLaboratoryObservations()))
foreach (BaseObservation obs in EnumerableCollection.toEnumerable(organizer.getLaboratoryObservations()))
{
String observationDesc;
Code code;
......
......@@ -61,6 +61,7 @@ public class DemoMtps
{
this.rscDir = rscDir;
txtLog = textBox;
initTestData();
}
/**
* The mDate is to allow better comparison of the output between releases.
......@@ -1312,7 +1313,7 @@ public class DemoMtps
pharmConcernEntry.setTextReference("#padv1.1");
// Problem Entry or Allergies & Intolerance
AbstractProblemConcern problemConcernEntry = new AbstractProblemConcern();
BaseProblemConcern problemConcernEntry = new BaseProblemConcern();
problemConcernEntry.setConcern("Nausees");
problemConcernEntry.setId(idPADVProblemEntry);
// problemConcernEntry.setEnd(null);
......
......@@ -250,7 +250,7 @@ public class DemoVacd
ProblemConcernStatusCode.COMPLETED);
keinLeiden.setId(
new Identificator(CdaChVacd.OID_MAIN, "1d6e8878-3d6a-2b34-6bc6-18565b12d5bc"));
((AbstractProblemEntry)keinLeiden.getProblemEntries().get(0)).setId(
((BaseProblemEntry)keinLeiden.getProblemEntries().get(0)).setId(
new Identificator(CdaChVacd.OID_MAIN, "1d6e581c-3d6a-2b34-7b87-18565b12d5bc"));
keinLeiden.setStart(DateUtil.parseDateyyyyMMdd("20150604"));
......@@ -689,7 +689,7 @@ public class DemoVacd
new Identificator(CdaChVacd.OID_MAIN, "21f4c3da-41f2-2b3e-9069-cb2de9e3981e"));
// set the relationship to the Immunization Request
impfempfehlung.addInFulfillmentOf(impfanfrage.getId());
impfempfehlung.addInFulfillmentOfOrder(impfanfrage.getId());
// mask the patients demographics
impfempfehlung.pseudonymization();
......
......@@ -394,7 +394,7 @@
<templateId root="1.3.6.1.4.1.19376.1.3.3.2.1"/>
<code code="18727-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="SEROLOGY STUDIES"/>
<title>Laborbefund - Serologie</title>
<text>Auftragsnummer: Unbekannt<br/>Befundstatus: Endgültiger Befund<br/><br/><table border="1" width="100%"><thead><tr><th>Zeile</th><th>Beobachtung</th><th>Resultat</th><th>Einheit</th><th>Interpretation</th><th>Referenz</th><th>Interpretation Referenz</th><th>Codesystem</th><th>Code</th><th>Original Name</th><th>Resultat erhalten</th><th>Kommentar</th><th>Hinweise</th></tr></thead><tbody><tr><td>1</td><td><content ID="lss1_18727-8_observation_1"/></td><td><content ID="lss1_18727-8_value_1">120.0</content></td><td>g/L</td><td/><td>100 - 130 g/L</td><td>Normal</td><td>LOINC</td><td>718-7</td><td>Hemoglobin [Mass/volume] in Blood</td><td>01.02.2015 00:00</td><td><content ID="lss1_18727-8_comment_1"/></td><td> <content ID="lss1_18727-8_collectiondate_1"/> <content ID="lss1_18727-8_specimenreceiveddate_1"/> <sup>1)</sup> </td></tr><tr><td>2</td><td><content ID="lss1_18727-8_observation_2"/></td><td><content ID="lss1_18727-8_value_2">Negative; Pathogen couldn't be determined in specimen</content></td><td/><td/><td/><td/><td>LOINC</td><td>22502-9</td><td>Measles virus Ab.IgG</td><td>01.02.2015 00:00</td><td><content ID="lss1_18727-8_comment_2"/></td><td> <content ID="lss1_18727-8_collectiondate_2"/> <content ID="lss1_18727-8_specimenreceiveddate_2"/> <sup>1)</sup> </td></tr></tbody></table><br/><sup>1) </sup>Ausführende Person: Unbekannt am 01.02.2015 00:00<br/></text>
<text>Auftragsnummer: Unbekannt<br/>Befundstatus: Endgültiger Befund<br/><br/><table border="1" width="100%"><thead><tr><th>Zeile</th><th>Beobachtung</th><th>Resultat</th><th>Einheit</th><th>Interpretation</th><th>Referenz</th><th>Interpretation Referenz</th><th>Codesystem</th><th>Code</th><th>Original Name</th><th>Resultat erhalten</th><th>Kommentar</th><th>Hinweise</th></tr></thead><tbody><tr><td>1</td><td><content ID="lss1_18727-8_observation_1"/></td><td><content ID="lss1_18727-8_value_1">120.0</content></td><td>g/L</td><td>Normal</td><td>100 - 130 g/L</td><td>Normal</td><td>LOINC</td><td>718-7</td><td>Hemoglobin [Mass/volume] in Blood</td><td>01.02.2015 00:00</td><td><content ID="lss1_18727-8_comment_1"/></td><td> <content ID="lss1_18727-8_collectiondate_1"/> <content ID="lss1_18727-8_specimenreceiveddate_1"/> <sup>1)</sup> </td></tr><tr><td>2</td><td><content ID="lss1_18727-8_observation_2"/></td><td><content ID="lss1_18727-8_value_2">Negative; Pathogen couldn't be determined in specimen</content></td><td/><td/><td/><td/><td>LOINC</td><td>22502-9</td><td>Measles virus Ab.IgG</td><td>01.02.2015 00:00</td><td><content ID="lss1_18727-8_comment_2"/></td><td> <content ID="lss1_18727-8_collectiondate_2"/> <content ID="lss1_18727-8_specimenreceiveddate_2"/> <sup>1)</sup> </td></tr></tbody></table><br/><sup>1) </sup>Ausführende Person: Unbekannt am 01.02.2015 00:00<br/></text>
<entry typeCode="DRIV">
<templateId root="1.3.6.1.4.1.19376.1.3.1"/>
<act classCode="ACT" moodCode="EVN">
......@@ -412,7 +412,6 @@
<statusCode code="completed"/>
<effectiveTime value="201502010000+0100"/>
<value xsi:type="PQ" value="120.0" unit="g/L"/>
<interpretationCode codeSystemName=""/>
<interpretationCode code="N" codeSystem="2.16.756.5.30.1.127.3.2.20121101.3" displayName="Normal"/>
<performer typeCode="PRF">
<time value="201502010000+0100"/>
......@@ -462,7 +461,6 @@
<statusCode code="completed"/>
<effectiveTime value="201502010000+0100"/>
<value xsi:type="CD" code="NEG" codeSystem="2.16.756.5.30.1.127.3.2.20121101.3" displayName="Negative; Pathogen couldn't be determined in specimen"/>
<interpretationCode codeSystemName=""/>
<interpretationCode nullFlavor="NA"/>
<performer typeCode="PRF">
<time value="201502010000+0100"/>
......
......@@ -49,7 +49,7 @@
<description value="Demo Submission Set NIST Cda"/>
<content>
<pReference>
<reference value="2.16.756.5.30.1.139.1.1.3.20180711010906122"/>
<reference value="2.16.756.5.30.1.139.1.1.3.20180721084119827"/>
</pReference>
</content>
</DocumentManifest>
......@@ -224,7 +224,7 @@
</extension>
<masterIdentifier>
<system value="urn:oid:2.16.756.5.30.1.139.1.1.3"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180711010906119"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180721084119824"/>
</masterIdentifier>
<status value="current"/>
<type>
......
......@@ -49,7 +49,7 @@
<description value="Demo Submission Set NIST Pdf"/>
<content>
<pReference>
<reference value="2.16.756.5.30.1.139.1.1.3.20180711010907161"/>
<reference value="2.16.756.5.30.1.139.1.1.3.20180721084120714"/>
</pReference>
</content>
</DocumentManifest>
......@@ -144,7 +144,7 @@
</extension>
<masterIdentifier>
<system value="urn:oid:2.16.756.5.30.1.139.1.1.3"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180711010907160"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180721084120714"/>
</masterIdentifier>
<status value="current"/>
<type>
......
......@@ -53,7 +53,7 @@
<description value="Demo Submission Set SwissEpr Cda"/>
<content>
<pReference>
<reference value="2.16.756.5.30.1.139.1.1.3.20180711010907220"/>
<reference value="2.16.756.5.30.1.139.1.1.3.20180721084120778"/>
</pReference>
</content>
</DocumentManifest>
......@@ -227,7 +227,7 @@
</extension>
<masterIdentifier>
<system value="urn:oid:2.16.756.5.30.1.139.1.1.3"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180711010907220"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180721084120777"/>
</masterIdentifier>
<status value="current"/>
<type>
......
......@@ -30,7 +30,7 @@
</extension>
<masterIdentifier>
<system value="urn:oid:2.16.756.5.30.1.139.1.1.3"/>
<value value="urn:uuid:5a4e0502-5a46-2d5a-7397-adaa1af1f57a"/>
<value value="urn:uuid:8d763544-6d72-2f6c-28a2-4ef861a762df"/>
</masterIdentifier>
<status value="current"/>
<type>
......@@ -53,7 +53,7 @@
<description value="Demo Submission Set SwissEpr Pdf"/>
<content>
<pReference>
<reference value="2.16.756.5.30.1.139.1.1.3.20180711010907277"/>
<reference value="2.16.756.5.30.1.139.1.1.3.20180721084120826"/>
</pReference>
</content>
</DocumentManifest>
......@@ -235,7 +235,7 @@
</extension>
<masterIdentifier>
<system value="urn:oid:2.16.756.5.30.1.139.1.1.3"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180711010907277"/>
<value value="2.16.756.5.30.1.139.1.1.3.20180721084120826"/>
</masterIdentifier>
<status value="current"/>
<type>
......
......@@ -23,9 +23,9 @@ import java.io.File;
import java.util.Date;
import org.apache.commons.io.FilenameUtils;
import org.ehealth_connector.cda.AbstractVitalSignObservation;
import org.ehealth_connector.cda.AllergyConcern;
import org.ehealth_connector.cda.AllergyProblem;
import org.ehealth_connector.cda.BaseVitalSignObservation;
import org.ehealth_connector.cda.Problem;
import org.ehealth_connector.cda.ch.ActiveProblemConcern;
import org.ehealth_connector.cda.ch.PastProblemConcern;
......@@ -880,7 +880,7 @@ public class DemoEdes {
*/
private String getInfoFromEdpnDemoDocument(CdaChEdesEdpn doc) {
String retVal = "";
for (final AbstractVitalSignObservation vitalSign : doc.getCodedVitalSigns()) {
for (final BaseVitalSignObservation vitalSign : doc.getCodedVitalSigns()) {
final String signName = vitalSign.getCode().getDisplayName();
final String signDateTime = DateUtil.formatDateTimeCh(vitalSign.getEffectiveTime());
final String signValue = vitalSign.getValue().getPhysicalQuantityValue() + " "
......
......@@ -27,7 +27,7 @@ import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.FileUtils;
import org.ehealth_connector.cda.AbstractObservation;
import org.ehealth_connector.cda.BaseObservation;
import org.ehealth_connector.cda.Section;
import org.ehealth_connector.cda.ch.lab.lrep.CdaChLrepV1GeneralReport;
import org.ehealth_connector.cda.ch.lab.lrep.LaboratoryBatteryOrganizer;
......@@ -948,10 +948,15 @@ public class DemoLrep {
CodeSystems.SwissAL.getCodeSystemName(), "Urin-Teilstatus, 5-10 Parameter"));
code.setOriginalText("pH im Urin");
obs.setCode(code);
// Note: unit definition in the Schema: use="optional" default="1"
// the setUcumUnit("1") call does therefore have no impact on the
// serialized CDA. This is ok!
value = new Value(new Integer(6));
value.setUcumUnit("1");
obs.addValue(value);
value = new Value(new BigDecimal(0.5), new BigDecimal(8));
value.setUcumUnit("1TODO");// Unit 1 wird nicht serialisiert...
// This is just to get the CDA valid against the Schematron rules
value.setUcumUnit("dummy");
refRange = new ReferenceRange(value, ObservationInterpretation.NORMAL);
obs.setReferenceRange(refRange);
battery.addLaboratoryObservation(obs);
......@@ -2020,7 +2025,7 @@ public class DemoLrep {
obs = new LaboratoryObservation();
code = new Code(CodeSystems.LOINC.getCodeSystemId(), "19153-6",
CodeSystems.LOINC.getCodeSystemName(),
" \r\n" + "Volume in Urine collected for unspecified duration");
"Volume in Urine collected for unspecified duration");
code.setOriginalText("Sammelvolumen");
obs.setCode(code);
value = new Value(new BigDecimal(2400));
......@@ -2584,7 +2589,7 @@ public class DemoLrep {
for (LaboratoryBatteryOrganizer organizer : section.getLaboratoryBatteries()) {
System.out.print(" - Battery of "
+ sdfTime.format(organizer.getEffectiveTime()) + "\n");
for (AbstractObservation obs : organizer.getLaboratoryObservations()) {
for (BaseObservation obs : organizer.getLaboratoryObservations()) {
String observationDesc;
Code code;
if (!obs.getCode().isNullFlavor()) {
......
......@@ -25,7 +25,7 @@ import java.util.Calendar;
import java.util.Date;
import org.apache.commons.io.FilenameUtils;
import org.ehealth_connector.cda.AbstractProblemConcern;
import org.ehealth_connector.cda.BaseProblemConcern;
import org.ehealth_connector.cda.Consumable;
import org.ehealth_connector.cda.ch.AbstractCdaChV1;
import org.ehealth_connector.cda.ch.enums.ParticipationFunction;
......@@ -1298,7 +1298,7 @@ public class DemoMtps {
pharmConcernEntry.setTextReference("#padv1.1");
// Problem Entry or Allergies & Intolerance
AbstractProblemConcern problemConcernEntry = new AbstractProblemConcern();
BaseProblemConcern problemConcernEntry = new BaseProblemConcern();
problemConcernEntry.setConcern("Nausees");
problemConcernEntry.setId(idPADVProblemEntry);
// problemConcernEntry.setEnd(null);
......
......@@ -698,7 +698,7 @@ public class DemoVacd {
new Identificator(CdaChVacd.OID_MAIN, "21f4c3da-41f2-2b3e-9069-cb2de9e3981e"));
// set the relationship to the Immunization Request
impfempfehlung.addInFulfillmentOf(impfanfrage.getId());
impfempfehlung.addInFulfillmentOfOrder(impfanfrage.getId());
// mask the patients demographics
impfempfehlung.pseudonymization();
......
......@@ -30,7 +30,7 @@ import org.ehealth_connector.cda.ch.edes.CdaChEdesCtnn;
import org.ehealth_connector.cda.ch.edes.CdaChEdesEdpn;
import org.ehealth_connector.common.enums.CountryCode;
import org.ehealth_connector.common.utils.DateUtil;
import org.ehealth_connector.converters.ch.AbstractCdaChFhirConverter;
import org.ehealth_connector.converters.ch.AbstractCdaChV12FhirConverter;
import org.ehealth_connector.fhir.structures.ch.FhirCdaChEdesCtnn.EdesCtnnDocument;
import org.ehealth_connector.fhir.structures.ch.FhirCdaChEdesEdpn.EdesEdpnDocument;
import org.ehealth_connector.fhir.structures.gen.FhirCommon;
......@@ -660,7 +660,7 @@ public class EdesResources {
System.out.println("Output Directory:" + rscDir);
final CodeableConcept docNormalConfCode = new CodeableConcept();
docNormalConfCode.addCoding().setSystem(AbstractCdaChFhirConverter.OID_CONFIDENTIALITY_CODE)
docNormalConfCode.addCoding().setSystem(AbstractCdaChV12FhirConverter.OID_CONFIDENTIALITY_CODE)
.setCode("normal");
docNormalConfidentiality = new Basic();
docNormalConfidentiality.setCode(docNormalConfCode);
......
......@@ -33,7 +33,7 @@ import org.ehealth_connector.common.enums.CodeSystems;
import org.ehealth_connector.common.enums.CountryCode;
import org.ehealth_connector.common.enums.ObservationInterpretation;
import org.ehealth_connector.common.utils.DateUtil;
import org.ehealth_connector.converters.ch.AbstractCdaChFhirConverter;
import org.ehealth_connector.converters.ch.AbstractCdaChV12FhirConverter;
import org.ehealth_connector.fhir.structures.ch.FhirCdaChLrtp.LrtpDocument;
import org.ehealth_connector.fhir.structures.gen.FhirCommon;
import org.ehealth_connector.fhir.structures.gen.FhirCommon.SaveMode;
......@@ -1197,7 +1197,7 @@ public class LrtpResources {
final CodeableConcept docRestrictedConfCode = new CodeableConcept();
docRestrictedConfCode.addCoding()
.setSystem(AbstractCdaChFhirConverter.OID_CONFIDENTIALITY_CODE).setCode("R");
.setSystem(AbstractCdaChV12FhirConverter.OID_CONFIDENTIALITY_CODE).setCode("R");
docRestrictedConfidentiality = new Basic();
docRestrictedConfidentiality.setCode(docRestrictedConfCode);
}
......
......@@ -19,10 +19,10 @@ package org.ehealth_connector.cda.ch;
import java.util.Comparator;
import org.ehealth_connector.cda.AbstractCda;
import org.ehealth_connector.cda.AbstractObservation;
import org.ehealth_connector.cda.AbstractOrganizer;
import org.ehealth_connector.cda.BaseObservation;
import org.ehealth_connector.cda.BaseOrganizer;
import org.ehealth_connector.cda.ch.textbuilder.ObservationChTextBuilder;
import org.ehealth_connector.cda.ihe.lab.AbstractLaboratorySpecialtySection;
import org.ehealth_connector.cda.ihe.lab.BaseLaboratorySpecialtySection;
import org.ehealth_connector.common.enums.CountryCode;
import org.ehealth_connector.common.enums.LanguageCode;
import org.ehealth_connector.common.utils.DateUtil;