mpps.setString(Tag.PerformedProcedureStepEndDate, VR.DA,
mpps.getString(Tag.PerformedProcedureStepStartDate));
mpps.setString(Tag.PerformedProcedureStepEndTime, VR.TM,
mpps.getString(Tag.PerformedProcedureStepStartTime));
mpps.setString(Tag.PerformedProcedureStepStatus, VR.CS, finalStatus);
Sequence dcrSeq = mpps.newSequence(Tag.PerformedProcedureStepDiscontinuationReasonCodeSequence, 1);
if (discontinuationReason != null)
dcrSeq.add(new Attributes(discontinuationReason));
Sequence raSeq = inst.getSequence(Tag.RequestAttributesSequence);
if (raSeq == null || raSeq.isEmpty()) {
Sequence ssaSeq =
mpps.newSequence(Tag.ScheduledStepAttributesSequence, 1);
Attributes ssa = new Attributes();
ssaSeq.add(ssa);
for (int tag : SSA_TYPE_2_ATTRS)
ssa.setNull(tag, dict.vrOf(tag));
ssa.addSelected(inst, SSA_ATTRS);
} else {
Sequence ssaSeq =
mpps.newSequence(Tag.ScheduledStepAttributesSequence, raSeq.size());
for (Attributes ra : raSeq) {
Attributes ssa = new Attributes();
ssaSeq.add(ssa);
for (int tag : SSA_TYPE_2_ATTRS)
ssa.setNull(tag, dict.vrOf(tag));
ssa.addSelected(inst, SSA_ATTRS);
ssa.addSelected(ra, SSA_ATTRS);
}