From cb028e70d34063520bf0b84ab26e8c9565d159a6 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 19 Feb 2020 09:11:56 +1100 Subject: [PATCH] fix convertors for ConceptMap and remove debugging statement --- .../convertors/conv10_50/ConceptMap10_50.java | 15 +++++++++++++++ .../convertors/conv14_50/ConceptMap14_50.java | 15 +++++++++++++++ .../convertors/conv30_50/ConceptMap30_50.java | 15 +++++++++++++++ .../convertors/conv40_50/ConceptMap40_50.java | 15 +++++++++++++++ .../org/hl7/fhir/r5/utils/NarrativeGenerator.java | 1 - 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java index bf64a8302..3125d6805 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java @@ -134,14 +134,19 @@ public class ConceptMap10_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; case BROADER: tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; case NOTRELATEDTO: tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; default: tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL); + break; } } return tgt; @@ -157,24 +162,34 @@ public class ConceptMap10_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case EQUAL: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case WIDER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case SUBSUMES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case SPECIALIZES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case INEXACT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); + break; case UNMATCHED: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; case DISJOINT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); + break; default: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java index eb3bd2d74..9238868c8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java @@ -142,14 +142,19 @@ public class ConceptMap14_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; case BROADER: tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.WIDER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; case NOTRELATEDTO: tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; default: tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NULL); + break; } } return tgt; @@ -165,24 +170,34 @@ public class ConceptMap14_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case EQUAL: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case WIDER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case SUBSUMES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case SPECIALIZES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case INEXACT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); + break; case UNMATCHED: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; case DISJOINT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); + break; default: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java index 0b833f5ca..2415be77d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java @@ -206,14 +206,19 @@ public class ConceptMap30_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; case BROADER: tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; case NOTRELATEDTO: tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; default: tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL); + break; } } return tgt; @@ -229,24 +234,34 @@ public class ConceptMap30_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case EQUAL: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case WIDER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case SUBSUMES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case SPECIALIZES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case INEXACT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); + break; case UNMATCHED: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; case DISJOINT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); + break; default: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap40_50.java index df0b19c6d..68b91ea46 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap40_50.java @@ -258,14 +258,19 @@ public class ConceptMap40_50 extends VersionConvertor_40_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; case BROADER: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; case NOTRELATEDTO: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; default: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); + break; } } return tgt; @@ -281,24 +286,34 @@ public class ConceptMap40_50 extends VersionConvertor_40_50 { switch(src.getValue()) { case EQUIVALENT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case EQUAL: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); + break; case WIDER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case SUBSUMES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER); + break; case NARROWER: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case SPECIALIZES: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER); + break; case INEXACT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); + break; case UNMATCHED: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; case DISJOINT: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); + break; default: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); + break; } return tgt; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java index d21eef6b6..c12b09585 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java @@ -4831,7 +4831,6 @@ public class NarrativeGenerator implements INarrativeGenerator { } public XhtmlNode renderBundle(Bundle b) throws FHIRException { - System.out.println("render "+b.getId()); if (b.getType() == BundleType.DOCUMENT) { if (!b.hasEntry() || !(b.getEntryFirstRep().hasResource() && b.getEntryFirstRep().getResource() instanceof Composition)) throw new FHIRException("Invalid document - first entry is not a Composition");