-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/flat add test for op 2 (#304)
* add roundTripEhrbaseConformanceDataTypesDvText see CDR-27 * fix junit dependency * fix test see CDR-27 * add test for dv_coded_text see CDR-27 * add test for dv_quantity see CDR-27 * add test for dv_quantity.range see CDR-27 * fix test see CDR-27 * update conformance template see CDR-27 * add test for interval of dv_quantity see CDR-27 * add test for DvProportion see CDR-27 * add test for DV_Count see CDR-27 * add test for DV_DATE_TIME , DV_TIME and DV_DATE see CDR-27 * add test for DvDuration see CDR-27 * fix test see CDR-27 * fix test see CDR-27 * add test for DV_ORDINAL see CDR-27 * add test for DvBoolean see CDR-27 * add test for DV_IDENTIFIER see CDR-27 * add test for Dv_uri & dv_ehr_uri see CDR-27 * add test for DvMultimedia & DvParsable see CDR-27 * fix test see CDR-27 * fix review see CDR-27 * add test for Element see CDR-27 * add test for Cluster see CDR-27 * add test for Event see CDR-27
- Loading branch information
1 parent
4f1489b
commit c7daee2
Showing
14 changed files
with
595 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...rialisation/flatencoding/std/marshal/postprocessor/IntervalEventMarshalPostprocessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* | ||
* * Copyright (c) 2020 Stefan Spiska (Vitasystems GmbH) and Hannover Medical School | ||
* * This file is part of Project EHRbase | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.ehrbase.serialisation.flatencoding.std.marshal.postprocessor; | ||
|
||
import com.nedap.archie.rm.datastructures.IntervalEvent; | ||
import org.ehrbase.serialisation.walker.Context; | ||
|
||
import java.util.Map; | ||
|
||
public class IntervalEventMarshalPostprocessor extends AbstractMarshalPostprocessor<IntervalEvent> { | ||
|
||
/** {@inheritDoc} Adds the encoding information */ | ||
@Override | ||
public void process( | ||
String term, | ||
IntervalEvent rmObject, | ||
Map<String, Object> values, | ||
Context<Map<String, Object>> context) { | ||
|
||
if (rmObject.getSampleCount() != null) { | ||
|
||
addValue(values,term,"sample_count",rmObject.getSampleCount()); | ||
} | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Class<IntervalEvent> getAssociatedClass() { | ||
return IntervalEvent.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...erialisation/flatencoding/std/umarshal/postprocessor/FeederAuditDetailsPostprocessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* | ||
* * Copyright (c) 2020 Stefan Spiska (Vitasystems GmbH) and Hannover Medical School | ||
* * This file is part of Project EHRbase | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.ehrbase.serialisation.flatencoding.std.umarshal.postprocessor; | ||
|
||
import com.nedap.archie.rm.archetyped.FeederAuditDetails; | ||
import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; | ||
import com.nedap.archie.rm.generic.PartyIdentified; | ||
import org.ehrbase.serialisation.walker.Context; | ||
import org.ehrbase.serialisation.walker.FlatHelper; | ||
import org.ehrbase.webtemplate.path.flat.FlatPathDto; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class FeederAuditDetailsPostprocessor extends AbstractUnmarshalPostprocessor<FeederAuditDetails> { | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public void process( | ||
String term, | ||
FeederAuditDetails rmObject, | ||
Map<FlatPathDto, String> values, | ||
Set<String> consumedPaths, | ||
Context<Map<FlatPathDto, String>> context) { | ||
|
||
Map<FlatPathDto, String> locationValues = FlatHelper.filter(values, term + "/_location", false); | ||
if(!locationValues.isEmpty() ){ | ||
rmObject.setLocation(new PartyIdentified()); | ||
handleRmAttribute(term,rmObject.getLocation(),locationValues,consumedPaths,context,"location" ); | ||
|
||
} | ||
|
||
Map<FlatPathDto, String> subjectValues = FlatHelper.filter(values, term + "/_subject", false); | ||
if(!subjectValues.isEmpty() ){ | ||
rmObject.setSubject(new PartyIdentified()); | ||
handleRmAttribute(term,rmObject.getSubject(),subjectValues,consumedPaths,context,"subject" ); | ||
|
||
} | ||
|
||
Map<FlatPathDto, String> providerValues = FlatHelper.filter(values, term + "/_provider", false); | ||
if(!providerValues.isEmpty() ){ | ||
rmObject.setProvider(new PartyIdentified()); | ||
handleRmAttribute(term,rmObject.getProvider(),providerValues,consumedPaths,context,"provider" ); | ||
|
||
} | ||
|
||
Map<FlatPathDto, String> timeValues = FlatHelper.filter(values, term + "/_time", false); | ||
if(!timeValues.isEmpty() ){ | ||
rmObject.setTime(new DvDateTime( )); | ||
handleRmAttribute(term,rmObject.getTime(),timeValues,consumedPaths,context,"time" ); | ||
|
||
} | ||
|
||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Class<FeederAuditDetails> getAssociatedClass() { | ||
return FeederAuditDetails.class; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...rbase/serialisation/flatencoding/std/umarshal/postprocessor/FeederAuditPostprocessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* | ||
* * Copyright (c) 2020 Stefan Spiska (Vitasystems GmbH) and Hannover Medical School | ||
* * This file is part of Project EHRbase | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.ehrbase.serialisation.flatencoding.std.umarshal.postprocessor; | ||
|
||
import com.nedap.archie.rm.archetyped.FeederAudit; | ||
import org.ehrbase.serialisation.walker.Context; | ||
import org.ehrbase.serialisation.walker.FlatHelper; | ||
import org.ehrbase.webtemplate.path.flat.FlatPathDto; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class FeederAuditPostprocessor extends AbstractUnmarshalPostprocessor<FeederAudit> { | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public void process( | ||
String term, | ||
FeederAudit rmObject, | ||
Map<FlatPathDto, String> values, | ||
Set<String> consumedPaths, | ||
Context<Map<FlatPathDto, String>> context) { | ||
|
||
Map<FlatPathDto, String> locationValues = FlatHelper.filter(values, term + "/originating_system_audit", false); | ||
if(!locationValues.isEmpty() && rmObject.getOriginatingSystemAudit() != null){ | ||
|
||
callPostProcess(term,"originating_system_audit",rmObject.getOriginatingSystemAudit(),locationValues,consumedPaths,context,null ); | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Class<FeederAudit> getAssociatedClass() { | ||
return FeederAudit.class; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...ase/serialisation/flatencoding/std/umarshal/postprocessor/IntervalEventPostprocessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* | ||
* * Copyright (c) 2020 Stefan Spiska (Vitasystems GmbH) and Hannover Medical School | ||
* * This file is part of Project EHRbase | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.ehrbase.serialisation.flatencoding.std.umarshal.postprocessor; | ||
|
||
import com.nedap.archie.rm.datastructures.IntervalEvent; | ||
import org.ehrbase.serialisation.walker.Context; | ||
import org.ehrbase.webtemplate.path.flat.FlatPathDto; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class IntervalEventPostprocessor extends AbstractUnmarshalPostprocessor<IntervalEvent> { | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public void process( | ||
String term, | ||
IntervalEvent rmObject, | ||
Map<FlatPathDto, String> values, | ||
Set<String> consumedPaths, | ||
Context<Map<FlatPathDto, String>> context) { | ||
|
||
setValue(term, "sample_count", values, rmObject::setSampleCount, Long.class, consumedPaths); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Class<IntervalEvent> getAssociatedClass() { | ||
return IntervalEvent.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.