-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix history origin in flat see CDR-273 * fix IsmTransition in flat see CDR-273 * fix test see CDR-273 * add CHANGELOG.md
- Loading branch information
1 parent
8940c46
commit 235def4
Showing
6 changed files
with
113 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
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
63 changes: 63 additions & 0 deletions
63
...base/serialisation/flatencoding/std/marshal/postprocessor/IsmTransitionPostprocessor.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,63 @@ | ||
/* | ||
* | ||
* * 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.composition.IsmTransition; | ||
import org.ehrbase.serialisation.walker.Context; | ||
|
||
import java.util.Map; | ||
import java.util.stream.IntStream; | ||
|
||
public class IsmTransitionPostprocessor extends AbstractMarshalPostprocessor<IsmTransition> { | ||
|
||
/** {@inheritDoc} Adds the encoding information */ | ||
@Override | ||
public void process( | ||
String term, | ||
IsmTransition rmObject, | ||
Map<String, Object> values, | ||
Context<Map<String, Object>> context) { | ||
|
||
IntStream.range(0, rmObject.getReason().size()) | ||
.forEach( | ||
i -> { | ||
callMarshal( | ||
term, | ||
"_reason:" + i, | ||
rmObject.getReason().get(i), | ||
values, | ||
context, | ||
context.getNodeDeque().peek().findChildById("mapping").orElse(null)); | ||
callPostprocess( | ||
term, | ||
"_reason:" + i, | ||
rmObject.getReason().get(i), | ||
values, | ||
context, | ||
context.getNodeDeque().peek().findChildById("mapping").orElse(null)); | ||
}); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Class<IsmTransition> getAssociatedClass() { | ||
return IsmTransition.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
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